Moved TypeTestCase to it's own namespace

This commit is contained in:
WouterJ 2013-04-12 17:49:02 +02:00
parent d450477ef3
commit e46f841a42
14 changed files with 85 additions and 37 deletions

View File

@ -135,6 +135,32 @@ UPGRADE FROM 2.x to 3.0
* `Symfony\Component\HttpKernel\Exception\FatalErrorException` -> `Symfony\Component\Debug\Exception\FatalErrorException` * `Symfony\Component\HttpKernel\Exception\FatalErrorException` -> `Symfony\Component\Debug\Exception\FatalErrorException`
* `Symfony\Component\HttpKernel\Exception\FlattenException` -> `Symfony\Component\Debug\Exception\FlattenException` * `Symfony\Component\HttpKernel\Exception\FlattenException` -> `Symfony\Component\Debug\Exception\FlattenException`
### Form
* The `TypeTestCase` class was moved from the `Symfony\Component\Form\Tests\Extension\Core\Type` namespace to the `Symfony\Component\Form\Test` namespace.
Before:
```
use Symfony\Component\Form\Tests\Extension\Core\Type\TypeTestCase
class MyTypeTest extends TypeTestCase
{
// ...
}
```
After:
```
use Symfony\Component\Form\Test\TypeTestCase;
class MyTypeTest extends TypeTestCase
{
// ...
}
```
### Routing ### Routing
* Some route settings have been renamed: * Some route settings have been renamed:

View File

@ -5,6 +5,7 @@ CHANGELOG
2.3.0 2.3.0
------ ------
* deprecated TypeTestCase in the Symfony\Component\Form\Tests\Extension\Core\Type namespace and moved it to the Symfony\Component\Form\Test namespace.
* changed FormRenderer::humanize() to humanize also camel cased field name * changed FormRenderer::humanize() to humanize also camel cased field name
* added FormProcessorInterface and FormInterface::process() * added FormProcessorInterface and FormInterface::process()
* deprecated passing a Request instance to FormInterface::bind() * deprecated passing a Request instance to FormInterface::bind()

View File

@ -0,0 +1,42 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Form\Test;
use Symfony\Component\Form\FormBuilder;
use Symfony\Component\Form\Tests\FormIntegrationTestCase;
use Symfony\Component\EventDispatcher\EventDispatcher;
abstract class TypeTestCase extends FormIntegrationTestCase
{
/**
* @var FormBuilder
*/
protected $builder;
/**
* @var EventDispatcher
*/
protected $dispatcher;
protected function setUp()
{
parent::setUp();
$this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
$this->builder = new FormBuilder(null, null, $this->dispatcher, $this->factory);
}
public static function assertDateTimeEquals(\DateTime $expected, \DateTime $actual)
{
self::assertEquals($expected->format('c'), $actual->format('c'));
}
}

View File

@ -14,7 +14,7 @@ namespace Symfony\Component\Form\Tests\Extension\Core\Type;
/** /**
* @author Bernhard Schussek <bschussek@gmail.com> * @author Bernhard Schussek <bschussek@gmail.com>
*/ */
abstract class BaseTypeTest extends TypeTestCase abstract class BaseTypeTest extends \Symfony\Component\Form\Test\TypeTestCase
{ {
public function testPassDisabledAsOption() public function testPassDisabledAsOption()
{ {

View File

@ -13,7 +13,7 @@ namespace Symfony\Component\Form\Tests\Extension\Core\Type;
use Symfony\Component\Form\CallbackTransformer; use Symfony\Component\Form\CallbackTransformer;
class CheckboxTypeTest extends TypeTestCase class CheckboxTypeTest extends \Symfony\Component\Form\Test\TypeTestCase
{ {
public function testPassValueToView() public function testPassValueToView()
{ {

View File

@ -14,7 +14,7 @@ namespace Symfony\Component\Form\Tests\Extension\Core\Type;
use Symfony\Component\Form\Extension\Core\ChoiceList\ObjectChoiceList; use Symfony\Component\Form\Extension\Core\ChoiceList\ObjectChoiceList;
use Symfony\Component\Form\Extension\Core\View\ChoiceView; use Symfony\Component\Form\Extension\Core\View\ChoiceView;
class ChoiceTypeTest extends TypeTestCase class ChoiceTypeTest extends \Symfony\Component\Form\Test\TypeTestCase
{ {
private $choices = array( private $choices = array(
'a' => 'Bernhard', 'a' => 'Bernhard',

View File

@ -13,7 +13,7 @@ namespace Symfony\Component\Form\Tests\Extension\Core\Type;
use Symfony\Component\Form\Form; use Symfony\Component\Form\Form;
class CollectionTypeTest extends TypeTestCase class CollectionTypeTest extends \Symfony\Component\Form\Test\TypeTestCase
{ {
public function testContainsNoChildByDefault() public function testContainsNoChildByDefault()
{ {

View File

@ -11,7 +11,7 @@
namespace Symfony\Component\Form\Tests\Extension\Core\Type; namespace Symfony\Component\Form\Tests\Extension\Core\Type;
class FileTypeTest extends TypeTestCase class FileTypeTest extends \Symfony\Component\Form\Test\TypeTestCase
{ {
// https://github.com/symfony/symfony/pull/5028 // https://github.com/symfony/symfony/pull/5028
public function testSetData() public function testSetData()

View File

@ -11,7 +11,7 @@
namespace Symfony\Component\Form\Tests\Extension\Core\Type; namespace Symfony\Component\Form\Tests\Extension\Core\Type;
class PasswordTypeTest extends TypeTestCase class PasswordTypeTest extends \Symfony\Component\Form\Test\TypeTestCase
{ {
public function testEmptyIfNotBound() public function testEmptyIfNotBound()
{ {

View File

@ -11,7 +11,7 @@
namespace Symfony\Component\Form\Tests\Extension\Core\Type; namespace Symfony\Component\Form\Tests\Extension\Core\Type;
class RepeatedTypeTest extends TypeTestCase class RepeatedTypeTest extends \Symfony\Component\Form\Test\TypeTestCase
{ {
protected $form; protected $form;

View File

@ -13,7 +13,7 @@ namespace Symfony\Component\Form\Tests\Extension\Core\Type;
use Symfony\Component\Form\Extension\Core\View\ChoiceView; use Symfony\Component\Form\Extension\Core\View\ChoiceView;
class TimezoneTypeTest extends TypeTestCase class TimezoneTypeTest extends \Symfony\Component\Form\Test\TypeTestCase
{ {
public function testTimezonesAreSelectable() public function testTimezonesAreSelectable()
{ {

View File

@ -11,32 +11,11 @@
namespace Symfony\Component\Form\Tests\Extension\Core\Type; namespace Symfony\Component\Form\Tests\Extension\Core\Type;
use Symfony\Component\Form\FormBuilder; use Symfony\Component\Form\Test\TypeTestCase as BaseTypeTestCase;
use Symfony\Component\Form\Tests\FormIntegrationTestCase;
use Symfony\Component\EventDispatcher\EventDispatcher;
abstract class TypeTestCase extends FormIntegrationTestCase /**
* @deprecated Deprecated since version 2.3, to be removed in 3.0. Use Symfony\Component\Form\Test\TypeTestCase instead.
*/
abstract class TypeTestCase extends BaseTypeTestCase
{ {
/**
* @var FormBuilder
*/
protected $builder;
/**
* @var EventDispatcher
*/
protected $dispatcher;
protected function setUp()
{
parent::setUp();
$this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
$this->builder = new FormBuilder(null, null, $this->dispatcher, $this->factory);
}
public static function assertDateTimeEquals(\DateTime $expected, \DateTime $actual)
{
self::assertEquals($expected->format('c'), $actual->format('c'));
}
} }

View File

@ -13,8 +13,8 @@ namespace Symfony\Component\Form\Tests\Extension\Csrf\Type;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\Test\TypeTestCase;
use Symfony\Component\Form\Extension\Csrf\CsrfExtension; use Symfony\Component\Form\Extension\Csrf\CsrfExtension;
use Symfony\Component\Form\Tests\Extension\Core\Type\TypeTestCase;
class FormTypeCsrfExtensionTest_ChildType extends AbstractType class FormTypeCsrfExtensionTest_ChildType extends AbstractType
{ {

View File

@ -11,10 +11,10 @@
namespace Symfony\Component\Form\Tests\Extension\Validator\Type; namespace Symfony\Component\Form\Tests\Extension\Validator\Type;
use Symfony\Component\Form\Tests\Extension\Core\Type\TypeTestCase as BaseTestCase; use Symfony\Component\Form\Test\TypeTestCase as BaseTypeTestCase;
use Symfony\Component\Form\Extension\Validator\ValidatorExtension; use Symfony\Component\Form\Extension\Validator\ValidatorExtension;
abstract class TypeTestCase extends BaseTestCase abstract class TypeTestCase extends BaseTypeTestCase
{ {
protected $validator; protected $validator;