Moved TypeTestCase to it's own namespace
This commit is contained in:
parent
d450477ef3
commit
e46f841a42
|
@ -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:
|
||||||
|
|
|
@ -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()
|
||||||
|
|
|
@ -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'));
|
||||||
|
}
|
||||||
|
}
|
|
@ -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()
|
||||||
{
|
{
|
||||||
|
|
|
@ -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()
|
||||||
{
|
{
|
||||||
|
|
|
@ -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',
|
||||||
|
|
|
@ -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()
|
||||||
{
|
{
|
||||||
|
|
|
@ -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()
|
||||||
|
|
|
@ -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()
|
||||||
{
|
{
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
@ -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()
|
||||||
{
|
{
|
||||||
|
|
|
@ -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'));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
{
|
{
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
|
Reference in New Issue