Skip to content

Commit bce32e2

Browse files
committed
minor #6199 fix types (garak)
This PR was submitted for the 3.0 branch but it was merged into the 2.8 branch instead (closes #6199). Discussion ---------- fix types | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 3.0, master | Fixed tickets | Commits ------- fcdb82b fix types
2 parents 372704b + fcdb82b commit bce32e2

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
@@ -136,7 +136,7 @@ before creating the parent form using the ``PreloadedExtension`` class::
136136
{
137137
protected function getExtensions()
138138
{
139-
$childType = new TestChildType();
139+
$childType = TestChildType::class;
140140

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

146146
public function testSubmitValidData()
147147
{
148-
$type = new TestedType();
148+
$type = TestedType::class;
149149
$form = $this->factory->create($type);
150150

151151
// ... your test

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy