File tree Expand file tree Collapse file tree 9 files changed +123
-81
lines changed Expand file tree Collapse file tree 9 files changed +123
-81
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ CHANGELOG
5
5
2.3.0
6
6
------
7
7
8
- * deprecated TypeTestCase in the Symfony\Component\Form\Tests\Extension\Core\Type namespace and moved it to the Symfony\Component\Form\Test namespace.
8
+ * deprecated FormPerformanceTestCase and FormIntegrationTestCase in the Symfony\Component\Form\Tests namespace and moved them to the Symfony\Component\Form\Test namespace
9
+ * deprecated TypeTestCase in the Symfony\Component\Form\Tests\Extension\Core\Type namespace and moved it to the Symfony\Component\Form\Test namespace
9
10
* changed FormRenderer::humanize() to humanize also camel cased field name
10
11
* added FormProcessorInterface and FormInterface::process()
11
12
* deprecated passing a Request instance to FormInterface::bind()
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Symfony package.
5
+ *
6
+ * (c) Fabien Potencier <fabien@symfony.com>
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 \Forms ;
15
+
16
+ /**
17
+ * @author Bernhard Schussek <bschussek@gmail.com>
18
+ */
19
+ abstract class FormIntegrationTestCase extends \PHPUnit_Framework_TestCase
20
+ {
21
+ /**
22
+ * @var \Symfony\Component\Form\FormFactoryInterface
23
+ */
24
+ protected $ factory ;
25
+
26
+ protected function setUp ()
27
+ {
28
+ if (!class_exists ('Symfony\Component\EventDispatcher\EventDispatcher ' )) {
29
+ $ this ->markTestSkipped ('The "EventDispatcher" component is not available ' );
30
+ }
31
+
32
+ $ this ->factory = Forms::createFormFactoryBuilder ()
33
+ ->addExtensions ($ this ->getExtensions ())
34
+ ->getFormFactory ();
35
+ }
36
+
37
+ protected function getExtensions ()
38
+ {
39
+ return array ();
40
+ }
41
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Symfony package.
5
+ *
6
+ * (c) Fabien Potencier <fabien@symfony.com>
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
+ /**
15
+ * Base class for performance tests.
16
+ *
17
+ * Copied from Doctrine 2's OrmPerformanceTestCase.
18
+ *
19
+ * @author robo
20
+ * @author Bernhard Schussek <bschussek@gmail.com>
21
+ */
22
+ abstract class FormPerformanceTestCase extends FormIntegrationTestCase
23
+ {
24
+ /**
25
+ * @var integer
26
+ */
27
+ protected $ maxRunningTime = 0 ;
28
+
29
+ /**
30
+ */
31
+ protected function runTest ()
32
+ {
33
+ $ s = microtime (true );
34
+ parent ::runTest ();
35
+ $ time = microtime (true ) - $ s ;
36
+
37
+ if ($ this ->maxRunningTime != 0 && $ time > $ this ->maxRunningTime ) {
38
+ $ this ->fail (
39
+ sprintf (
40
+ 'expected running time: <= %s but was: %s ' ,
41
+
42
+ $ this ->maxRunningTime ,
43
+ $ time
44
+ )
45
+ );
46
+ }
47
+ }
48
+
49
+ /**
50
+ * @param integer $maxRunningTime
51
+ * @throws \InvalidArgumentException
52
+ */
53
+ public function setMaxRunningTime ($ maxRunningTime )
54
+ {
55
+ if (is_integer ($ maxRunningTime ) && $ maxRunningTime >= 0 ) {
56
+ $ this ->maxRunningTime = $ maxRunningTime ;
57
+ } else {
58
+ throw new \InvalidArgumentException ;
59
+ }
60
+ }
61
+
62
+ /**
63
+ * @return integer
64
+ * @since Method available since Release 2.3.0
65
+ */
66
+ public function getMaxRunningTime ()
67
+ {
68
+ return $ this ->maxRunningTime ;
69
+ }
70
+ }
Original file line number Diff line number Diff line change 12
12
namespace Symfony \Component \Form \Test ;
13
13
14
14
use Symfony \Component \Form \FormBuilder ;
15
- use Symfony \Component \Form \Tests \FormIntegrationTestCase ;
16
15
use Symfony \Component \EventDispatcher \EventDispatcher ;
17
16
18
17
abstract class TypeTestCase extends FormIntegrationTestCase
Original file line number Diff line number Diff line change 15
15
use Symfony \Component \Form \FormView ;
16
16
use Symfony \Component \Form \Extension \Csrf \CsrfExtension ;
17
17
18
- abstract class AbstractLayoutTest extends FormIntegrationTestCase
18
+ abstract class AbstractLayoutTest extends \ Symfony \ Component \ Form \ Test \ FormIntegrationTestCase
19
19
{
20
20
protected $ csrfProvider ;
21
21
Original file line number Diff line number Diff line change 14
14
/**
15
15
* @author Bernhard Schussek <bschussek@gmail.com>
16
16
*/
17
- class CompoundFormPerformanceTest extends FormPerformanceTestCase
17
+ class CompoundFormPerformanceTest extends \ Symfony \ Component \ Form \ Tests \ FormPerformanceTestCase
18
18
{
19
19
/**
20
20
* Create a compound form multiple times, as happens in a collection form
Original file line number Diff line number Diff line change 11
11
12
12
namespace Symfony \Component \Form \Tests \Extension \Core \Type ;
13
13
14
- use Symfony \Component \Form \Tests \FormPerformanceTestCase ;
14
+ use Symfony \Component \Form \Test \FormPerformanceTestCase ;
15
15
16
16
/**
17
17
* @author Bernhard Schussek <bschussek@gmail.com>
Original file line number Diff line number Diff line change 11
11
12
12
namespace Symfony \Component \Form \Tests ;
13
13
14
- use Symfony \Component \Form \Forms ;
14
+ use Symfony \Component \Form \Test \ FormIntegrationTestCase as BaseFormIntegrationTestCase ;
15
15
16
16
/**
17
- * @author Bernhard Schussek <bschussek@gmail.com>
17
+ * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use Symfony\Component\Form\Test\FormIntegrationTestCase instead.
18
18
*/
19
- abstract class FormIntegrationTestCase extends \PHPUnit_Framework_TestCase
19
+ abstract class FormIntegrationTestCase extends BaseFormIntegrationTestCase
20
20
{
21
- /**
22
- * @var \Symfony\Component\Form\FormFactoryInterface
23
- */
24
- protected $ factory ;
25
-
26
- protected function setUp ()
27
- {
28
- if (!class_exists ('Symfony\Component\EventDispatcher\EventDispatcher ' )) {
29
- $ this ->markTestSkipped ('The "EventDispatcher" component is not available ' );
30
- }
31
-
32
- $ this ->factory = Forms::createFormFactoryBuilder ()
33
- ->addExtensions ($ this ->getExtensions ())
34
- ->getFormFactory ();
35
- }
36
-
37
- protected function getExtensions ()
38
- {
39
- return array ();
40
- }
41
21
}
Original file line number Diff line number Diff line change 11
11
12
12
namespace Symfony \Component \Form \Tests ;
13
13
14
+ use Symfony \Component \Form \Test \FormPerformanceTestCase as BaseFormPerformanceTestCase ;
15
+
14
16
/**
15
- * Base class for performance tests.
16
- *
17
- * Copied from Doctrine 2's OrmPerformanceTestCase.
18
- *
19
- * @author robo
20
- * @author Bernhard Schussek <bschussek@gmail.com>
17
+ * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use Symfony\Component\Form\Test\FormPerformanceTestCase instead.
21
18
*/
22
- abstract class FormPerformanceTestCase extends FormIntegrationTestCase
19
+ abstract class FormPerformanceTestCase extends BaseFormPerformanceTestCase
23
20
{
24
- /**
25
- * @var integer
26
- */
27
- protected $ maxRunningTime = 0 ;
28
-
29
- /**
30
- */
31
- protected function runTest ()
32
- {
33
- $ s = microtime (true );
34
- parent ::runTest ();
35
- $ time = microtime (true ) - $ s ;
36
-
37
- if ($ this ->maxRunningTime != 0 && $ time > $ this ->maxRunningTime ) {
38
- $ this ->fail (
39
- sprintf (
40
- 'expected running time: <= %s but was: %s ' ,
41
-
42
- $ this ->maxRunningTime ,
43
- $ time
44
- )
45
- );
46
- }
47
- }
48
-
49
- /**
50
- * @param integer $maxRunningTime
51
- * @throws \InvalidArgumentException
52
- */
53
- public function setMaxRunningTime ($ maxRunningTime )
54
- {
55
- if (is_integer ($ maxRunningTime ) && $ maxRunningTime >= 0 ) {
56
- $ this ->maxRunningTime = $ maxRunningTime ;
57
- } else {
58
- throw new \InvalidArgumentException ;
59
- }
60
- }
61
-
62
- /**
63
- * @return integer
64
- * @since Method available since Release 2.3.0
65
- */
66
- public function getMaxRunningTime ()
67
- {
68
- return $ this ->maxRunningTime ;
69
- }
70
21
}
You can’t perform that action at this time.
0 commit comments