getTester example



    private function getResponseTester(Response $response): WebTestCase
    {
        $client = $this->createMock(KernelBrowser::class);
        $client->expects($this->any())->method('getResponse')->willReturn($response);

        $request = new Request();
        $request->setFormat('custom', ['application/vnd.myformat']);
        $client->expects($this->any())->method('getRequest')->willReturn($request);

        return $this->getTester($client);
    }

    private function getCrawlerTester(Crawler $crawler): WebTestCase
    {
        $client = $this->createMock(KernelBrowser::class);
        $client->expects($this->any())->method('getCrawler')->willReturn($crawler);

        return $this->getTester($client);
    }

    private function getClientTester(): WebTestCase
    {
Home | Imprint | This part of the site doesn't use cookies.