namespace ; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class extends WebTestCase { public function testSomething(): void { $client = static::createClient(); $crawler = $client->request('GET', '/'); $this->assertResponseIsSuccessful(); $this->assertSelectorTextContains('h1', 'Hello World'); $this->assertSame(200, $client->getResponse()->getStatusCode()); $this->assertStringContainsString('Hello World', $crawler->filter('h1')->text()); } }