getClientAuthenticated(); $client->request( 'GET', "/api/1.0/main/address-reference/by-postal-code/{$postCodeId}/search.json", ['q' => $pattern] ); $this->assertResponseIsSuccessful(); } public static function provideData() { self::bootKernel(); /** @var EntityManagerInterface $em */ $em = self::getContainer()->get(EntityManagerInterface::class); $postalCode = $em->createQueryBuilder() ->select('pc') ->from(PostalCode::class, 'pc') ->where('pc.origin = :origin') ->setParameter('origin', 0) ->setMaxResults(1) ->getQuery() ->getSingleResult(); yield [$postalCode->getId(), 'rue']; } }