Skip to content

Commit

Permalink
update test project
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Apr 10, 2010
1 parent eddd279 commit 811aaa6
Show file tree
Hide file tree
Showing 76 changed files with 846 additions and 436 deletions.
Binary file modified dmCorePlugin/test/project/data/db.sqlite
Binary file not shown.
Binary file modified dmCorePlugin/test/project/data/fresh_db.sqlite
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,27 @@ abstract class BaseDmTestCategFormFilter extends BaseFormFilterDoctrine
public function setup()
{
$this->setWidgets(array(
'created_at' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormInputText(array(), array("class" => "datepicker_me")), 'to_date' => new sfWidgetFormInputText(array(), array("class" => "datepicker_me")), 'with_empty' => false)),
'updated_at' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormInputText(array(), array("class" => "datepicker_me")), 'to_date' => new sfWidgetFormInputText(array(), array("class" => "datepicker_me")), 'with_empty' => false)),
'position' => new sfWidgetFormFilterInput(),
'created_at' => new sfWidgetFormChoice(array('choices' => array(
'' => '',
'today' => $this->getI18n()->__('Today'),
'week' => $this->getI18n()->__('Past %number% days', array('%number%' => 7)),
'month' => $this->getI18n()->__('This month'),
'year' => $this->getI18n()->__('This year')
))),
'updated_at' => new sfWidgetFormChoice(array('choices' => array(
'' => '',
'today' => $this->getI18n()->__('Today'),
'week' => $this->getI18n()->__('Past %number% days', array('%number%' => 7)),
'month' => $this->getI18n()->__('This month'),
'year' => $this->getI18n()->__('This year')
))),
'position' => new sfWidgetFormDmFilterInput(),
'domains_list' => new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'DmTestDomain')),
));

$this->setValidators(array(
'created_at' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
'updated_at' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
'created_at' => new sfValidatorChoice(array('required' => false, 'choices' => array_keys($this->widgetSchema['created_at']->getOption('choices')))),
'updated_at' => new sfValidatorChoice(array('required' => false, 'choices' => array_keys($this->widgetSchema['updated_at']->getOption('choices')))),
'position' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
'domains_list' => new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'DmTestDomain', 'required' => false)),
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ abstract class BaseDmTestCategTranslationFormFilter extends BaseFormFilterDoctri
public function setup()
{
$this->setWidgets(array(
'name' => new sfWidgetFormFilterInput(),
'is_active' => new sfWidgetFormChoice(array('choices' => array('' => dm::getI18n()->__('yes or no', array(), 'dm'), 1 => dm::getI18n()->__('yes', array(), 'dm'), 0 => dm::getI18n()->__('no', array(), 'dm')))),
'name' => new sfWidgetFormDmFilterInput(),
'is_active' => new sfWidgetFormChoice(array('choices' => array('' => $this->getI18n()->__('yes or no', array(), 'dm'), 1 => $this->getI18n()->__('yes', array(), 'dm'), 0 => $this->getI18n()->__('no', array(), 'dm')))),
));

$this->setValidators(array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,33 @@ public function setup()
{
$this->setWidgets(array(
'post_id' => new sfWidgetFormDoctrineChoice(array('model' => 'DmTestPost', 'add_empty' => true)),
'author' => new sfWidgetFormFilterInput(),
'body' => new sfWidgetFormFilterInput(),
'is_active' => new sfWidgetFormChoice(array('choices' => array('' => dm::getI18n()->__('yes or no', array(), 'dm'), 1 => dm::getI18n()->__('yes', array(), 'dm'), 0 => dm::getI18n()->__('no', array(), 'dm')))),
'created_at' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormInputText(array(), array("class" => "datepicker_me")), 'to_date' => new sfWidgetFormInputText(array(), array("class" => "datepicker_me")), 'with_empty' => false)),
'updated_at' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormInputText(array(), array("class" => "datepicker_me")), 'to_date' => new sfWidgetFormInputText(array(), array("class" => "datepicker_me")), 'with_empty' => false)),
'version' => new sfWidgetFormFilterInput(),
'author' => new sfWidgetFormDmFilterInput(),
'body' => new sfWidgetFormDmFilterInput(),
'is_active' => new sfWidgetFormChoice(array('choices' => array('' => $this->getI18n()->__('yes or no', array(), 'dm'), 1 => $this->getI18n()->__('yes', array(), 'dm'), 0 => $this->getI18n()->__('no', array(), 'dm')))),
'created_at' => new sfWidgetFormChoice(array('choices' => array(
'' => '',
'today' => $this->getI18n()->__('Today'),
'week' => $this->getI18n()->__('Past %number% days', array('%number%' => 7)),
'month' => $this->getI18n()->__('This month'),
'year' => $this->getI18n()->__('This year')
))),
'updated_at' => new sfWidgetFormChoice(array('choices' => array(
'' => '',
'today' => $this->getI18n()->__('Today'),
'week' => $this->getI18n()->__('Past %number% days', array('%number%' => 7)),
'month' => $this->getI18n()->__('This month'),
'year' => $this->getI18n()->__('This year')
))),
'version' => new sfWidgetFormDmFilterInput(),
));

$this->setValidators(array(
'post_id' => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Post'), 'column' => 'id')),
'author' => new sfValidatorPass(array('required' => false)),
'body' => new sfValidatorPass(array('required' => false)),
'is_active' => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
'created_at' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
'updated_at' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
'created_at' => new sfValidatorChoice(array('required' => false, 'choices' => array_keys($this->widgetSchema['created_at']->getOption('choices')))),
'updated_at' => new sfValidatorChoice(array('required' => false, 'choices' => array_keys($this->widgetSchema['updated_at']->getOption('choices')))),
'version' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,33 @@ abstract class BaseDmTestCommentVersionFormFilter extends BaseFormFilterDoctrine
public function setup()
{
$this->setWidgets(array(
'post_id' => new sfWidgetFormFilterInput(),
'author' => new sfWidgetFormFilterInput(),
'body' => new sfWidgetFormFilterInput(),
'is_active' => new sfWidgetFormChoice(array('choices' => array('' => dm::getI18n()->__('yes or no', array(), 'dm'), 1 => dm::getI18n()->__('yes', array(), 'dm'), 0 => dm::getI18n()->__('no', array(), 'dm')))),
'created_at' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormInputText(array(), array("class" => "datepicker_me")), 'to_date' => new sfWidgetFormInputText(array(), array("class" => "datepicker_me")), 'with_empty' => false)),
'updated_at' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormInputText(array(), array("class" => "datepicker_me")), 'to_date' => new sfWidgetFormInputText(array(), array("class" => "datepicker_me")), 'with_empty' => false)),
'post_id' => new sfWidgetFormDmFilterInput(),
'author' => new sfWidgetFormDmFilterInput(),
'body' => new sfWidgetFormDmFilterInput(),
'is_active' => new sfWidgetFormChoice(array('choices' => array('' => $this->getI18n()->__('yes or no', array(), 'dm'), 1 => $this->getI18n()->__('yes', array(), 'dm'), 0 => $this->getI18n()->__('no', array(), 'dm')))),
'created_at' => new sfWidgetFormChoice(array('choices' => array(
'' => '',
'today' => $this->getI18n()->__('Today'),
'week' => $this->getI18n()->__('Past %number% days', array('%number%' => 7)),
'month' => $this->getI18n()->__('This month'),
'year' => $this->getI18n()->__('This year')
))),
'updated_at' => new sfWidgetFormChoice(array('choices' => array(
'' => '',
'today' => $this->getI18n()->__('Today'),
'week' => $this->getI18n()->__('Past %number% days', array('%number%' => 7)),
'month' => $this->getI18n()->__('This month'),
'year' => $this->getI18n()->__('This year')
))),
));

$this->setValidators(array(
'post_id' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
'author' => new sfValidatorPass(array('required' => false)),
'body' => new sfValidatorPass(array('required' => false)),
'is_active' => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
'created_at' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
'updated_at' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
'created_at' => new sfValidatorChoice(array('required' => false, 'choices' => array_keys($this->widgetSchema['created_at']->getOption('choices')))),
'updated_at' => new sfValidatorChoice(array('required' => false, 'choices' => array_keys($this->widgetSchema['updated_at']->getOption('choices')))),
));

$this->widgetSchema->setNameFormat('dm_test_comment_version_filters[%s]');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,28 @@ abstract class BaseDmTestDomainFormFilter extends BaseFormFilterDoctrine
public function setup()
{
$this->setWidgets(array(
'created_at' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormInputText(array(), array("class" => "datepicker_me")), 'to_date' => new sfWidgetFormInputText(array(), array("class" => "datepicker_me")), 'with_empty' => false)),
'updated_at' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormInputText(array(), array("class" => "datepicker_me")), 'to_date' => new sfWidgetFormInputText(array(), array("class" => "datepicker_me")), 'with_empty' => false)),
'position' => new sfWidgetFormFilterInput(),
'created_at' => new sfWidgetFormChoice(array('choices' => array(
'' => '',
'today' => $this->getI18n()->__('Today'),
'week' => $this->getI18n()->__('Past %number% days', array('%number%' => 7)),
'month' => $this->getI18n()->__('This month'),
'year' => $this->getI18n()->__('This year')
))),
'updated_at' => new sfWidgetFormChoice(array('choices' => array(
'' => '',
'today' => $this->getI18n()->__('Today'),
'week' => $this->getI18n()->__('Past %number% days', array('%number%' => 7)),
'month' => $this->getI18n()->__('This month'),
'year' => $this->getI18n()->__('This year')
))),
'position' => new sfWidgetFormDmFilterInput(),
'categs_list' => new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'DmTestCateg')),
'tags_list' => new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'DmTag')),
));

$this->setValidators(array(
'created_at' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
'updated_at' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
'created_at' => new sfValidatorChoice(array('required' => false, 'choices' => array_keys($this->widgetSchema['created_at']->getOption('choices')))),
'updated_at' => new sfValidatorChoice(array('required' => false, 'choices' => array_keys($this->widgetSchema['updated_at']->getOption('choices')))),
'position' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
'categs_list' => new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'DmTestCateg', 'required' => false)),
'tags_list' => new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'DmTag', 'required' => false)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ abstract class BaseDmTestDomainTranslationFormFilter extends BaseFormFilterDoctr
public function setup()
{
$this->setWidgets(array(
'title' => new sfWidgetFormFilterInput(),
'is_active' => new sfWidgetFormChoice(array('choices' => array('' => dm::getI18n()->__('yes or no', array(), 'dm'), 1 => dm::getI18n()->__('yes', array(), 'dm'), 0 => dm::getI18n()->__('no', array(), 'dm')))),
'title' => new sfWidgetFormDmFilterInput(),
'is_active' => new sfWidgetFormChoice(array('choices' => array('' => $this->getI18n()->__('yes or no', array(), 'dm'), 1 => $this->getI18n()->__('yes', array(), 'dm'), 0 => $this->getI18n()->__('no', array(), 'dm')))),
'created_by' => new sfWidgetFormDoctrineChoice(array('model' => 'DmUser', 'add_empty' => true)),
'updated_by' => new sfWidgetFormDoctrineChoice(array('model' => 'DmUser', 'add_empty' => true)),
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ abstract class BaseDmTestFruitFormFilter extends BaseFormFilterDoctrine
public function setup()
{
$this->setWidgets(array(
'title' => new sfWidgetFormFilterInput(),
'title' => new sfWidgetFormDmFilterInput(),
'created_by' => new sfWidgetFormDoctrineChoice(array('model' => 'DmUser', 'add_empty' => true)),
'updated_by' => new sfWidgetFormDoctrineChoice(array('model' => 'DmUser', 'add_empty' => true)),
'tags_list' => new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'DmTag')),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,29 @@ public function setup()
'user_id' => new sfWidgetFormDoctrineChoice(array('model' => 'DmUser', 'add_empty' => true)),
'image_id' => new sfWidgetFormDoctrineChoice(array('model' => 'DmMedia', 'add_empty' => true)),
'file_id' => new sfWidgetFormDoctrineChoice(array('model' => 'DmMedia', 'add_empty' => true)),
'date' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormInputText(array(), array("class" => "datepicker_me")), 'to_date' => new sfWidgetFormInputText(array(), array("class" => "datepicker_me")), 'with_empty' => false)),
'date' => new sfWidgetFormChoice(array('choices' => array(
'' => '',
'today' => $this->getI18n()->__('Today'),
'week' => $this->getI18n()->__('Past %number% days', array('%number%' => 7)),
'month' => $this->getI18n()->__('This month'),
'year' => $this->getI18n()->__('This year')
))),
'created_by' => new sfWidgetFormDoctrineChoice(array('model' => 'DmUser', 'add_empty' => true)),
'created_at' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormInputText(array(), array("class" => "datepicker_me")), 'to_date' => new sfWidgetFormInputText(array(), array("class" => "datepicker_me")), 'with_empty' => false)),
'updated_at' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormInputText(array(), array("class" => "datepicker_me")), 'to_date' => new sfWidgetFormInputText(array(), array("class" => "datepicker_me")), 'with_empty' => false)),
'position' => new sfWidgetFormFilterInput(),
'created_at' => new sfWidgetFormChoice(array('choices' => array(
'' => '',
'today' => $this->getI18n()->__('Today'),
'week' => $this->getI18n()->__('Past %number% days', array('%number%' => 7)),
'month' => $this->getI18n()->__('This month'),
'year' => $this->getI18n()->__('This year')
))),
'updated_at' => new sfWidgetFormChoice(array('choices' => array(
'' => '',
'today' => $this->getI18n()->__('Today'),
'week' => $this->getI18n()->__('Past %number% days', array('%number%' => 7)),
'month' => $this->getI18n()->__('This month'),
'year' => $this->getI18n()->__('This year')
))),
'position' => new sfWidgetFormDmFilterInput(),
'tags_list' => new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'DmTestTag')),
'medias_list' => new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'DmMedia')),
));
Expand All @@ -31,10 +49,10 @@ public function setup()
'user_id' => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Author'), 'column' => 'id')),
'image_id' => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Image'), 'column' => 'id')),
'file_id' => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('File'), 'column' => 'id')),
'date' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
'date' => new sfValidatorChoice(array('required' => false, 'choices' => array_keys($this->widgetSchema['date']->getOption('choices')))),
'created_by' => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('CreatedBy'), 'column' => 'id')),
'created_at' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
'updated_at' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
'created_at' => new sfValidatorChoice(array('required' => false, 'choices' => array_keys($this->widgetSchema['created_at']->getOption('choices')))),
'updated_at' => new sfValidatorChoice(array('required' => false, 'choices' => array_keys($this->widgetSchema['updated_at']->getOption('choices')))),
'position' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
'tags_list' => new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'DmTestTag', 'required' => false)),
'medias_list' => new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'DmMedia', 'required' => false)),
Expand Down
Loading

0 comments on commit 811aaa6

Please sign in to comment.