Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 03c6605

Browse files
committed
Merge branch '2.8' into 3.0
* 2.8: fix types Revert "revert form login CSRF changes on wrong branch" revert form login CSRF changes on wrong branch
2 parents beb0d3a + bce32e2 commit 03c6605

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cookbook/form/unit_testing.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ The simplest ``TypeTestCase`` implementation looks like the following::
5252
'test2' => 'test2',
5353
);
5454

55-
$type = new TestedType();
55+
$type = TestedType::class;
5656
$form = $this->factory->create($type);
5757

5858
$object = TestObject::fromArray($formData);
@@ -78,7 +78,7 @@ First you verify if the ``FormType`` compiles. This includes basic class
7878
inheritance, the ``buildForm`` function and options resolution. This should
7979
be the first test you write::
8080

81-
$type = new TestedType();
81+
$type = TestedType::class;
8282
$form = $this->factory->create($type);
8383

8484
This test checks that none of your data transformers used by the form
@@ -139,7 +139,7 @@ before creating the parent form using the ``PreloadedExtension`` class::
139139
{
140140
protected function getExtensions()
141141
{
142-
$childType = new TestChildType();
142+
$childType = TestChildType::class;
143143

144144
return array(new PreloadedExtension(array(
145145
$childType->getName() => $childType,
@@ -148,7 +148,7 @@ before creating the parent form using the ``PreloadedExtension`` class::
148148

149149
public function testSubmitValidData()
150150
{
151-
$type = new TestedType();
151+
$type = TestedType::class;
152152
$form = $this->factory->create($type);
153153

154154
// ... your test

0 commit comments

Comments
 (0)