From 8849d8bb5424ba5ee1ddca0e0fe80c2cc4658c8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 29 Dec 2015 17:54:00 +0100 Subject: [PATCH] fix test for custom field helper The test was requesting an entity not present in database --- Tests/Service/CustomFieldsHelperTest.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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()