Skip to content

Commit 4df9f34

Browse files
authored
[Testing] use static::getContainer()
self::$container is deprecated since symfony5.3
1 parent 433e05d commit 4df9f34

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

testing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ the container is stored in ``self::$container``::
262262
self::bootKernel();
263263

264264
// (2) use self::$container to access the service container
265-
$container = self::$container;
265+
$container = static::getContainer();
266266

267267
// (3) run some service & test the result
268268
$newsletterGenerator = $container->get(NewsletterGenerator::class);
@@ -272,7 +272,7 @@ the container is stored in ``self::$container``::
272272
}
273273
}
274274

275-
The container in ``self::$container`` is actually a special test container.
275+
The container in ``static::getContainer()`` is actually a special test container.
276276
It gives you access to both the public services and the non-removed
277277
:ref:`private services <container-public>` services.
278278

0 commit comments

Comments
 (0)