Skip to content

Commit e7bdc62

Browse files
committed
Moved TypeTestCase to it's own namespace
1 parent eccff74 commit e7bdc62

13 files changed

+59
-37
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ CHANGELOG
55
2.3.0
66
------
77

8+
* deprecated TypeTestCase in the Symfony\Component\Form\Tests\Extension\Core\Type namespace and moved it to the Symfony\Component\Form\Test namespace.
89
* changed FormRenderer::humanize() to humanize also camel cased field name
910
* added FormProcessorInterface and FormInterface::process()
1011
* deprecated passing a Request instance to FormInterface::bind()

Test/TypeTestCase.php

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Form\Test;
13+
14+
use Symfony\Component\Form\FormBuilder;
15+
use Symfony\Component\Form\Tests\FormIntegrationTestCase;
16+
use Symfony\Component\EventDispatcher\EventDispatcher;
17+
18+
abstract class TypeTestCase extends FormIntegrationTestCase
19+
{
20+
/**
21+
* @var FormBuilder
22+
*/
23+
protected $builder;
24+
25+
/**
26+
* @var EventDispatcher
27+
*/
28+
protected $dispatcher;
29+
30+
protected function setUp()
31+
{
32+
parent::setUp();
33+
34+
$this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
35+
$this->builder = new FormBuilder(null, null, $this->dispatcher, $this->factory);
36+
}
37+
38+
public static function assertDateTimeEquals(\DateTime $expected, \DateTime $actual)
39+
{
40+
self::assertEquals($expected->format('c'), $actual->format('c'));
41+
}
42+
}

Tests/Extension/Core/Type/BaseTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/**
1515
* @author Bernhard Schussek <[email protected]>
1616
*/
17-
abstract class BaseTypeTest extends TypeTestCase
17+
abstract class BaseTypeTest extends \Symfony\Component\Form\Test\TypeTestCase
1818
{
1919
public function testPassDisabledAsOption()
2020
{

Tests/Extension/Core/Type/CheckboxTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use Symfony\Component\Form\CallbackTransformer;
1515

16-
class CheckboxTypeTest extends TypeTestCase
16+
class CheckboxTypeTest extends \Symfony\Component\Form\Test\TypeTestCase
1717
{
1818
public function testPassValueToView()
1919
{

Tests/Extension/Core/Type/ChoiceTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Symfony\Component\Form\Extension\Core\ChoiceList\ObjectChoiceList;
1515
use Symfony\Component\Form\Extension\Core\View\ChoiceView;
1616

17-
class ChoiceTypeTest extends TypeTestCase
17+
class ChoiceTypeTest extends \Symfony\Component\Form\Test\TypeTestCase
1818
{
1919
private $choices = array(
2020
'a' => 'Bernhard',

Tests/Extension/Core/Type/CollectionTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use Symfony\Component\Form\Form;
1515

16-
class CollectionTypeTest extends TypeTestCase
16+
class CollectionTypeTest extends \Symfony\Component\Form\Test\TypeTestCase
1717
{
1818
public function testContainsNoChildByDefault()
1919
{

Tests/Extension/Core/Type/FileTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Component\Form\Tests\Extension\Core\Type;
1313

14-
class FileTypeTest extends TypeTestCase
14+
class FileTypeTest extends \Symfony\Component\Form\Test\TypeTestCase
1515
{
1616
// https://github.com/symfony/symfony/pull/5028
1717
public function testSetData()

Tests/Extension/Core/Type/PasswordTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Component\Form\Tests\Extension\Core\Type;
1313

14-
class PasswordTypeTest extends TypeTestCase
14+
class PasswordTypeTest extends \Symfony\Component\Form\Test\TypeTestCase
1515
{
1616
public function testEmptyIfNotBound()
1717
{

Tests/Extension/Core/Type/RepeatedTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Component\Form\Tests\Extension\Core\Type;
1313

14-
class RepeatedTypeTest extends TypeTestCase
14+
class RepeatedTypeTest extends \Symfony\Component\Form\Test\TypeTestCase
1515
{
1616
protected $form;
1717

Tests/Extension/Core/Type/TimezoneTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use Symfony\Component\Form\Extension\Core\View\ChoiceView;
1515

16-
class TimezoneTypeTest extends TypeTestCase
16+
class TimezoneTypeTest extends \Symfony\Component\Form\Test\TypeTestCase
1717
{
1818
public function testTimezonesAreSelectable()
1919
{

Tests/Extension/Core/Type/TypeTestCase.php

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,11 @@
1111

1212
namespace Symfony\Component\Form\Tests\Extension\Core\Type;
1313

14-
use Symfony\Component\Form\FormBuilder;
15-
use Symfony\Component\Form\Tests\FormIntegrationTestCase;
16-
use Symfony\Component\EventDispatcher\EventDispatcher;
14+
use Symfony\Component\Form\Test\TypeTestCase as BaseTypeTestCase;
1715

18-
abstract class TypeTestCase extends FormIntegrationTestCase
16+
/**
17+
* @deprecated Deprecated since version 2.3, to be removed in 3.0. Use Symfony\Component\Form\Test\TypeTestCase instead.
18+
*/
19+
abstract class TypeTestCase extends BaseTypeTestCase
1920
{
20-
/**
21-
* @var FormBuilder
22-
*/
23-
protected $builder;
24-
25-
/**
26-
* @var EventDispatcher
27-
*/
28-
protected $dispatcher;
29-
30-
protected function setUp()
31-
{
32-
parent::setUp();
33-
34-
$this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
35-
$this->builder = new FormBuilder(null, null, $this->dispatcher, $this->factory);
36-
}
37-
38-
public static function assertDateTimeEquals(\DateTime $expected, \DateTime $actual)
39-
{
40-
self::assertEquals($expected->format('c'), $actual->format('c'));
41-
}
4221
}

Tests/Extension/Csrf/Type/FormTypeCsrfExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
use Symfony\Component\Form\AbstractType;
1515
use Symfony\Component\Form\FormBuilderInterface;
16+
use Symfony\Component\Form\Test\TypeTestCase;
1617
use Symfony\Component\Form\Extension\Csrf\CsrfExtension;
17-
use Symfony\Component\Form\Tests\Extension\Core\Type\TypeTestCase;
1818

1919
class FormTypeCsrfExtensionTest_ChildType extends AbstractType
2020
{

Tests/Extension/Validator/Type/TypeTestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111

1212
namespace Symfony\Component\Form\Tests\Extension\Validator\Type;
1313

14-
use Symfony\Component\Form\Tests\Extension\Core\Type\TypeTestCase as BaseTestCase;
14+
use Symfony\Component\Form\Test\TypeTestCase as BaseTypeTestCase;
1515
use Symfony\Component\Form\Extension\Validator\ValidatorExtension;
1616

17-
abstract class TypeTestCase extends BaseTestCase
17+
abstract class TypeTestCase extends BaseTypeTestCase
1818
{
1919
protected $validator;
2020

0 commit comments

Comments
 (0)