diff --git a/Tests/Service/CustomFieldsHelperTest.php b/Tests/Service/CustomFieldsHelperTest.php index 82092bf1c..fc7276cf7 100644 --- a/Tests/Service/CustomFieldsHelperTest.php +++ b/Tests/Service/CustomFieldsHelperTest.php @@ -52,11 +52,13 @@ class CustomFieldsHelperTest extends KernelTestCase $this->cfHelper = $container->get('chill.custom_field.helper'); - $cfieldsText = $container->get('doctrine.orm.entity_manager') - ->getRepository('ChillCustomFieldsBundle:CustomField') - ->findBy(array('type' => 'text')) - ; - $this->randomCFText = end($cfieldsText); + $this->randomCFText = (new CustomField()) + ->setSlug('my-slug') + ->setActive(true) + ->setName(array('fr' => 'my cf')) + ->setOptions(array('maxLength' => 1000)) + ->setType('text') + ; } public function testRenderCustomField()