add an "active" field on activity type

This commit is contained in:
2016-11-14 23:00:13 +01:00
parent 79dd4bfac8
commit 5dda66342a
8 changed files with 116 additions and 31 deletions

View File

@@ -67,11 +67,11 @@ class TranslatableActivityTypeTest extends KernelTestCase
*
* @return \Chill\ActivityBundle\Entity\ActivityType
*/
protected function getRandomType()
protected function getRandomType($active = true)
{
$types = $this->container->get('doctrine.orm.entity_manager')
->getRepository('ChillActivityBundle:ActivityType')
->findAll();
->findBy(array('active' => $active));
return $types[array_rand($types)];
}
@@ -93,7 +93,8 @@ class TranslatableActivityTypeTest extends KernelTestCase
$this->assertEquals($type->getId(), $form->getData()['type']->getId());
// test the ordering of the types in the form
$view = $form->createView();
// since 2016-11-14 the types are not alphabetically ordered, skipping
/*$view = $form->createView();
$this->assertGreaterThan(0, count($view['type']->vars['choices']),
"test that there are at least one choice");
@@ -106,7 +107,7 @@ class TranslatableActivityTypeTest extends KernelTestCase
$this->assertTrue($previous < $choice->label);
$previous = $choice->label;
}
}
}*/
}