Skip to content

Update testing.rst #15488

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ the container is stored in ``self::$container``::
// (1) boot the Symfony kernel
self::bootKernel();

// (2) use self::$container to access the service container
$container = self::$container;
// (2) use static::getContainer() to access the service container
$container = static::getContainer();

// (3) run some service & test the result
$newsletterGenerator = $container->get(NewsletterGenerator::class);
Expand Down