Explorar o código

[Form] Moved Doctrine2 specific files

Bernhard Schussek %!s(int64=14) %!d(string=hai) anos
pai
achega
d152b5e265

+ 1 - 3
src/Symfony/Component/Form/Extension/Doctrine/EntityChoiceField.php

@@ -9,10 +9,8 @@
  * file that was distributed with this source code.
  */
 
-namespace Symfony\Component\Form\Extension\Doctrine;
+namespace Symfony\Component\Form;
 
-use Symfony\Component\Form\ChoiceField;
-use Symfony\Component\Form\PropertyPath;
 use Symfony\Component\Form\ValueTransformer\TransformationFailedException;
 use Symfony\Component\Form\Exception\FormException;
 use Symfony\Component\Form\Exception\InvalidOptionsException;

+ 1 - 4
src/Symfony/Component/Form/Extension/Doctrine/EntityFieldFactoryGuesser.php

@@ -9,11 +9,8 @@
  * file that was distributed with this source code.
  */
 
-namespace Symfony\Component\Form\Extension\Doctrine;
+namespace Symfony\Component\Form\FieldFactory;
 
-use Symfony\Component\Form\FieldFactory\FieldFactoryGuesserInterface;
-use Symfony\Component\Form\FieldFactory\FieldFactoryGuess;
-use Symfony\Component\Form\FieldFactory\FieldFactoryClassGuess;
 use Doctrine\ORM\EntityManager;
 
 /**

+ 1 - 3
src/Symfony/Component/Form/Extension/Doctrine/CollectionToStringTransformer.php

@@ -9,10 +9,8 @@
  * file that was distributed with this source code.
  */
 
-namespace Symfony\Component\Form\Extension\Doctrine;
+namespace Symfony\Component\Form\ValueTransformer;
 
-use Symfony\Component\Form\ValueTransformer\BaseValueTransformer;
-use Symfony\Component\Form\ValueTransformer\TransformationFailedException;
 use Doctrine\Common\Collections\Collection;
 
 /**

+ 2 - 2
tests/Symfony/Tests/Component/Form/Extension/Doctrine/TestCase.php

@@ -9,7 +9,7 @@
  * file that was distributed with this source code.
  */
 
-namespace Symfony\Tests\Component\Form\Extension\Doctrine;
+namespace Symfony\Tests\Component\Form;
 
 use Doctrine\ORM\EntityManager;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -17,7 +17,7 @@ use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
 use Symfony\Bundle\DoctrineBundle\DependencyInjection\DoctrineExtension;
 use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
 
-class TestCase extends \PHPUnit_Framework_TestCase
+class DoctrineOrmTestCase extends \PHPUnit_Framework_TestCase
 {
     protected function setUp()
     {

+ 8 - 8
tests/Symfony/Tests/Component/Form/Extension/Doctrine/EntityChoiceFieldTest.php

@@ -9,24 +9,24 @@
  * file that was distributed with this source code.
  */
 
-namespace Symfony\Tests\Component\Form\Extension\Doctrine;
+namespace Symfony\Tests\Component\Form;
 
-require_once __DIR__.'/TestCase.php';
+require_once __DIR__.'/DoctrineOrmTestCase.php';
 require_once __DIR__.'/Fixtures/SingleIdentEntity.php';
 require_once __DIR__.'/Fixtures/CompositeIdentEntity.php';
 
-use Symfony\Component\Form\Extension\Doctrine\EntityChoiceField;
+use Symfony\Component\Form\EntityChoiceField;
 use Symfony\Component\Form\Exception\UnexpectedTypeException;
-use Symfony\Tests\Component\Form\Extension\Doctrine\Fixtures\SingleIdentEntity;
-use Symfony\Tests\Component\Form\Extension\Doctrine\Fixtures\CompositeIdentEntity;
+use Symfony\Tests\Component\Form\Fixtures\SingleIdentEntity;
+use Symfony\Tests\Component\Form\Fixtures\CompositeIdentEntity;
 use Doctrine\ORM\Tools\SchemaTool;
 use Doctrine\Common\Collections\ArrayCollection;
 
-class EntityChoiceFieldTest extends TestCase
+class EntityChoiceFieldTest extends DoctrineOrmTestCase
 {
-    const SINGLE_IDENT_CLASS = 'Symfony\Tests\Component\Form\Extension\Doctrine\Fixtures\SingleIdentEntity';
+    const SINGLE_IDENT_CLASS = 'Symfony\Tests\Component\Form\Fixtures\SingleIdentEntity';
 
-    const COMPOSITE_IDENT_CLASS = 'Symfony\Tests\Component\Form\Extension\Doctrine\Fixtures\CompositeIdentEntity';
+    const COMPOSITE_IDENT_CLASS = 'Symfony\Tests\Component\Form\Fixtures\CompositeIdentEntity';
 
     /**
      * @var EntityManager

+ 1 - 1
tests/Symfony/Tests/Component/Form/Extension/Doctrine/Fixtures/CompositeIdentEntity.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace Symfony\Tests\Component\Form\Extension\Doctrine\Fixtures;
+namespace Symfony\Tests\Component\Form\Fixtures;
 
 /** @Entity */
 class CompositeIdentEntity

+ 1 - 1
tests/Symfony/Tests/Component/Form/Extension/Doctrine/Fixtures/SingleIdentEntity.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace Symfony\Tests\Component\Form\Extension\Doctrine\Fixtures;
+namespace Symfony\Tests\Component\Form\Fixtures;
 
 /** @Entity */
 class SingleIdentEntity

+ 5 - 4
tests/Symfony/Tests/Component/Form/Extension/Doctrine/CollectionToStringTransformerTest.php

@@ -9,15 +9,16 @@
  * file that was distributed with this source code.
  */
 
-namespace Symfony\Tests\Component\Form\Extension\Doctrine;
+namespace Symfony\Tests\Component\Form\ValueTransformer;
 
-require_once __DIR__.'/TestCase.php';
+require_once __DIR__.'/../DoctrineOrmTestCase.php';
 
-use Symfony\Component\Form\Extension\Doctrine\CollectionToStringTransformer;
+use Symfony\Tests\Component\Form\DoctrineOrmTestCase;
+use Symfony\Component\Form\ValueTransformer\CollectionToStringTransformer;
 use Doctrine\Common\Collections\ArrayCollection;
 use Doctrine\ORM\Tools\SchemaTool;
 
-class CollectionToStringTransformerTest extends TestCase
+class CollectionToStringTransformerTest extends DoctrineOrmTestCase
 {
     /**
      * @var EntityManager