From 6e60967827e748c8168ad4aed2a0c33e8c9cd376 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sat, 4 Feb 2012 08:08:27 +0100 Subject: [PATCH] [DoctrineBridge] fixed a unit test after the 2.0 merge --- .../Fixtures/NoToStringSingleIdentEntity.php | 22 +++++++++++++++++++ .../Form/ChoiceList/EntityChoiceListTest.php | 8 ++++--- 2 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 tests/Symfony/Tests/Bridge/Doctrine/Fixtures/NoToStringSingleIdentEntity.php diff --git a/tests/Symfony/Tests/Bridge/Doctrine/Fixtures/NoToStringSingleIdentEntity.php b/tests/Symfony/Tests/Bridge/Doctrine/Fixtures/NoToStringSingleIdentEntity.php new file mode 100644 index 0000000000..47ba3625bb --- /dev/null +++ b/tests/Symfony/Tests/Bridge/Doctrine/Fixtures/NoToStringSingleIdentEntity.php @@ -0,0 +1,22 @@ +id = $id; + $this->name = $name; + } +} diff --git a/tests/Symfony/Tests/Bridge/Doctrine/Form/ChoiceList/EntityChoiceListTest.php b/tests/Symfony/Tests/Bridge/Doctrine/Form/ChoiceList/EntityChoiceListTest.php index 56a5aa3128..7b9f628898 100644 --- a/tests/Symfony/Tests/Bridge/Doctrine/Form/ChoiceList/EntityChoiceListTest.php +++ b/tests/Symfony/Tests/Bridge/Doctrine/Form/ChoiceList/EntityChoiceListTest.php @@ -14,10 +14,12 @@ namespace Symfony\Tests\Bridge\Doctrine\Form\ChoiceList; require_once __DIR__.'/../../DoctrineOrmTestCase.php'; require_once __DIR__.'/../../Fixtures/ItemGroupEntity.php'; require_once __DIR__.'/../../Fixtures/SingleIdentEntity.php'; +require_once __DIR__.'/../../Fixtures/NoToStringSingleIdentEntity.php'; use Symfony\Tests\Bridge\Doctrine\DoctrineOrmTestCase; use Symfony\Tests\Bridge\Doctrine\Fixtures\ItemGroupEntity; use Symfony\Tests\Bridge\Doctrine\Fixtures\SingleIdentEntity; +use Symfony\Tests\Bridge\Doctrine\Fixtures\NoToStringSingleIdentEntity; use Symfony\Bridge\Doctrine\Form\ChoiceList\EntityChoiceList; use Symfony\Component\Form\Extension\Core\View\ChoiceView; @@ -51,8 +53,8 @@ class EntityChoiceListTest extends DoctrineOrmTestCase */ public function testEntitesMustHaveAToStringMethod() { - $entity1 = new SingleIdentEntity(1, 'Foo'); - $entity2 = new SingleIdentEntity(2, 'Bar'); + $entity1 = new NoToStringSingleIdentEntity(1, 'Foo'); + $entity2 = new NoToStringSingleIdentEntity(2, 'Bar'); // Persist for managed state $this->em->persist($entity1); @@ -69,7 +71,7 @@ class EntityChoiceListTest extends DoctrineOrmTestCase ) ); - $choiceList->getEntities(); + $choiceList->getValues(); } /**