From 0108cd4c90c4f2361958462209f0128caef8d351 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sat, 28 Nov 2015 11:07:17 +0100 Subject: [PATCH] remove unused abstract test classes --- ...bstractEntityChoiceListCompositeIdTest.php | 58 ------------ ...bstractEntityChoiceListSingleIntIdTest.php | 58 ------------ ...ractEntityChoiceListSingleStringIdTest.php | 58 ------------ .../AbstractEntityChoiceListTest.php | 88 ------------------- 4 files changed, 262 deletions(-) delete mode 100644 src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/AbstractEntityChoiceListCompositeIdTest.php delete mode 100644 src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/AbstractEntityChoiceListSingleIntIdTest.php delete mode 100644 src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/AbstractEntityChoiceListSingleStringIdTest.php delete mode 100644 src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/AbstractEntityChoiceListTest.php diff --git a/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/AbstractEntityChoiceListCompositeIdTest.php b/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/AbstractEntityChoiceListCompositeIdTest.php deleted file mode 100644 index 5980d9c734..0000000000 --- a/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/AbstractEntityChoiceListCompositeIdTest.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Tests\Form\ChoiceList; - -use Symfony\Bridge\Doctrine\Tests\Fixtures\CompositeIntIdEntity; - -/** - * @author Bernhard Schussek - */ -abstract class AbstractEntityChoiceListCompositeIdTest extends AbstractEntityChoiceListTest -{ - protected function getEntityClass() - { - return 'Symfony\Bridge\Doctrine\Tests\Fixtures\CompositeIntIdEntity'; - } - - /** - * @return \Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface - */ - protected function createObjects() - { - return array( - new CompositeIntIdEntity(10, 11, 'A'), - new CompositeIntIdEntity(20, 21, 'B'), - new CompositeIntIdEntity(30, 31, 'C'), - new CompositeIntIdEntity(40, 41, 'D'), - ); - } - - protected function getChoices() - { - return array(0 => $this->obj1, 1 => $this->obj2, 2 => $this->obj3, 3 => $this->obj4); - } - - protected function getLabels() - { - return array(0 => 'A', 1 => 'B', 2 => 'C', 3 => 'D'); - } - - protected function getValues() - { - return array(0 => '0', 1 => '1', 2 => '2', 3 => '3'); - } - - protected function getIndices() - { - return array(0, 1, 2, 3); - } -} diff --git a/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/AbstractEntityChoiceListSingleIntIdTest.php b/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/AbstractEntityChoiceListSingleIntIdTest.php deleted file mode 100644 index 74af66db36..0000000000 --- a/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/AbstractEntityChoiceListSingleIntIdTest.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Tests\Form\ChoiceList; - -use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity; - -/** - * @author Bernhard Schussek - */ -abstract class AbstractEntityChoiceListSingleIntIdTest extends AbstractEntityChoiceListTest -{ - protected function getEntityClass() - { - return 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity'; - } - - /** - * @return \Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface - */ - protected function createObjects() - { - return array( - new SingleIntIdEntity(-10, 'A'), - new SingleIntIdEntity(10, 'B'), - new SingleIntIdEntity(20, 'C'), - new SingleIntIdEntity(30, 'D'), - ); - } - - protected function getChoices() - { - return array('_10' => $this->obj1, 10 => $this->obj2, 20 => $this->obj3, 30 => $this->obj4); - } - - protected function getLabels() - { - return array('_10' => 'A', 10 => 'B', 20 => 'C', 30 => 'D'); - } - - protected function getValues() - { - return array('_10' => '-10', 10 => '10', 20 => '20', 30 => '30'); - } - - protected function getIndices() - { - return array('_10', 10, 20, 30); - } -} diff --git a/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/AbstractEntityChoiceListSingleStringIdTest.php b/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/AbstractEntityChoiceListSingleStringIdTest.php deleted file mode 100644 index 56b4c21319..0000000000 --- a/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/AbstractEntityChoiceListSingleStringIdTest.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Tests\Form\ChoiceList; - -use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleStringIdEntity; - -/** - * @author Bernhard Schussek - */ -abstract class AbstractEntityChoiceListSingleStringIdTest extends AbstractEntityChoiceListTest -{ - protected function getEntityClass() - { - return 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleStringIdEntity'; - } - - /** - * @return \Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface - */ - protected function createObjects() - { - return array( - new SingleStringIdEntity('a', 'A'), - new SingleStringIdEntity('b', 'B'), - new SingleStringIdEntity('c', 'C'), - new SingleStringIdEntity('d', 'D'), - ); - } - - protected function getChoices() - { - return array(0 => $this->obj1, 1 => $this->obj2, 2 => $this->obj3, 3 => $this->obj4); - } - - protected function getLabels() - { - return array(0 => 'A', 1 => 'B', 2 => 'C', 3 => 'D'); - } - - protected function getValues() - { - return array(0 => 'a', 1 => 'b', 2 => 'c', 3 => 'd'); - } - - protected function getIndices() - { - return array(0, 1, 2, 3); - } -} diff --git a/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/AbstractEntityChoiceListTest.php b/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/AbstractEntityChoiceListTest.php deleted file mode 100644 index 4f3d54a30f..0000000000 --- a/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/AbstractEntityChoiceListTest.php +++ /dev/null @@ -1,88 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bridge\Doctrine\Tests\Form\ChoiceList; - -use Symfony\Bridge\Doctrine\Test\DoctrineTestHelper; -use Symfony\Bridge\Doctrine\Form\ChoiceList\EntityChoiceList; -use Doctrine\ORM\Tools\SchemaTool; -use Symfony\Component\Form\Tests\Extension\Core\ChoiceList\AbstractChoiceListTest; - -/** - * @author Bernhard Schussek - */ -abstract class AbstractEntityChoiceListTest extends AbstractChoiceListTest -{ - /** - * @var \Doctrine\ORM\EntityManager - */ - protected $em; - - protected $obj1; - - protected $obj2; - - protected $obj3; - - protected $obj4; - - protected function setUp() - { - $this->em = DoctrineTestHelper::createTestEntityManager(); - - $schemaTool = new SchemaTool($this->em); - $classes = $this->getClassesMetadata(); - - try { - $schemaTool->dropSchema($classes); - } catch (\Exception $e) { - } - - try { - $schemaTool->createSchema($classes); - } catch (\Exception $e) { - } - - list($this->obj1, $this->obj2, $this->obj3, $this->obj4) = $this->createObjects(); - - $this->em->persist($this->obj1); - $this->em->persist($this->obj2); - $this->em->persist($this->obj3); - $this->em->persist($this->obj4); - $this->em->flush(); - - parent::setUp(); - } - - protected function tearDown() - { - parent::tearDown(); - - $this->em = null; - } - - abstract protected function getEntityClass(); - - abstract protected function createObjects(); - - protected function getClassesMetadata() - { - return array($this->em->getClassMetadata($this->getEntityClass())); - } - - /** - * @return \Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface - */ - protected function createChoiceList() - { - return new EntityChoiceList($this->em, $this->getEntityClass()); - } -}