Skip to content

Update DefaultControllerTest.php #1568

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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: 3 additions & 1 deletion tests/Controller/DefaultControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ public function testPublicUrls(string $url): void
}

/**
* A good practice for tests is to not use the service container, to make
* A good practice for such tests is to not use the service container, to make
* them more robust. However, in this example we must access to the container
* to get the entity manager and make a database query. The reason is that
* blog post fixtures are randomly generated and there's no guarantee that
* a given blog post slug will be available.
* You can also make some integration test to test services logic.
* See https://symfony.com/doc/current/testing.html#integration-tests
*/
public function testPublicBlogPost(): void
{
Expand Down