@@ -20,22 +20,22 @@ class PageControllerTest extends AbstractTestCase
20
20
public function testNoHomepage (): void
21
21
{
22
22
$ error = 'No homepage has been configured. Please check your existing pages or create a homepage in your application. (404 Not Found) ' ;
23
- $ client = static ::createClient ();
23
+ $ client = self ::createClient ();
24
24
$ crawler = $ client ->request ('GET ' , '/page/ ' );
25
25
static ::assertEquals ($ error , trim ($ crawler ->filter ('title ' )->html ()));
26
26
static ::assertEquals (404 , $ client ->getResponse ()->getStatusCode ());
27
27
}
28
28
29
29
public function testNoPageWithSlug (): void
30
30
{
31
- $ client = static ::createClient ();
31
+ $ client = self ::createClient ();
32
32
$ client ->request ('GET ' , '/page/inexistent-slug ' );
33
33
static ::assertEquals (404 , $ client ->getResponse ()->getStatusCode ());
34
34
}
35
35
36
36
public function testOneHomepage (): void
37
37
{
38
- $ client = static ::createClient ();
38
+ $ client = self ::createClient ();
39
39
40
40
$ homepage = $ this ->createPage ([
41
41
'homepage ' => true ,
@@ -47,7 +47,7 @@ public function testOneHomepage(): void
47
47
]);
48
48
49
49
/** @var EntityManagerInterface $em */
50
- $ em = static :: $ container ->get (EntityManagerInterface::class);
50
+ $ em = self :: getContainer () ->get (EntityManagerInterface::class);
51
51
$ em ->persist ($ homepage );
52
52
$ em ->flush ();
53
53
@@ -74,7 +74,7 @@ public function testOneHomepage(): void
74
74
75
75
public function testOneHomepageWithLocale (): void
76
76
{
77
- $ client = static ::createClient ();
77
+ $ client = self ::createClient ();
78
78
79
79
$ homepage = $ this ->createPage ([
80
80
'homepage ' => true ,
@@ -87,7 +87,7 @@ public function testOneHomepageWithLocale(): void
87
87
]);
88
88
89
89
/** @var EntityManagerInterface $em */
90
- $ em = static :: $ container ->get (EntityManagerInterface::class);
90
+ $ em = self :: getContainer () ->get (EntityManagerInterface::class);
91
91
$ em ->persist ($ homepage );
92
92
$ em ->flush ();
93
93
@@ -114,10 +114,10 @@ public function testOneHomepageWithLocale(): void
114
114
115
115
public function testTree (): void
116
116
{
117
- $ client = static ::createClient ();
117
+ $ client = self ::createClient ();
118
118
119
119
/** @var EntityManagerInterface $em */
120
- $ em = static :: $ container ->get (EntityManagerInterface::class);
120
+ $ em = self :: getContainer () ->get (EntityManagerInterface::class);
121
121
122
122
// Prepare 3 pages : the root, the first level, and the third one that's disabled
123
123
$ root = $ this ->createPage ([
@@ -163,10 +163,10 @@ public function testTree(): void
163
163
164
164
public function testMetas (): void
165
165
{
166
- $ client = static ::createClient ();
166
+ $ client = self ::createClient ();
167
167
168
168
/** @var EntityManagerInterface $em */
169
- $ em = static :: $ container ->get (EntityManagerInterface::class);
169
+ $ em = self :: getContainer () ->get (EntityManagerInterface::class);
170
170
171
171
$ page = $ this ->createPage ([
172
172
'homepage ' => true ,
@@ -198,9 +198,9 @@ public function testMetas(): void
198
198
199
199
public function testParentAndChildrenDontReverse (): void
200
200
{
201
- $ client = static ::createClient ();
201
+ $ client = self ::createClient ();
202
202
/** @var EntityManagerInterface $em */
203
- $ em = static :: $ container ->get (EntityManagerInterface::class);
203
+ $ em = self :: getContainer () ->get (EntityManagerInterface::class);
204
204
205
205
$ parent = $ this ->createPage ([
206
206
'enabled ' => true ,
@@ -236,10 +236,10 @@ public function testParentAndChildrenDontReverse(): void
236
236
*/
237
237
public function testAllTypesOfPagesForHomepage (): void
238
238
{
239
- $ client = static ::createClient ();
239
+ $ client = self ::createClient ();
240
240
241
241
/** @var EntityManagerInterface $em */
242
- $ em = static :: $ container ->get (EntityManagerInterface::class);
242
+ $ em = self :: getContainer () ->get (EntityManagerInterface::class);
243
243
244
244
// First, create the pages
245
245
/** @var Page[] $pages */
@@ -290,10 +290,10 @@ public function testAllTypesOfPagesForHomepage(): void
290
290
291
291
public function testBreadcrumbsDesign (): void
292
292
{
293
- $ client = static ::createClient (['environment ' => 'design_breadcrumbs ' ]);
293
+ $ client = self ::createClient (['environment ' => 'design_breadcrumbs ' ]);
294
294
295
295
/** @var EntityManagerInterface $em */
296
- $ em = static :: $ container ->get (EntityManagerInterface::class);
296
+ $ em = self :: getContainer () ->get (EntityManagerInterface::class);
297
297
298
298
$ page = $ this ->createPage (['enabled ' => true , 'slug ' => 'parent ' , 'title ' => 'Parent page ' ]);
299
299
$ em ->persist ($ page );
0 commit comments