Created
November 15, 2018 08:48
-
-
Save RajithaKumara/7d0aedba083d1e2cea9e1e893b22c0fc to your computer and use it in GitHub Desktop.
Here this $client comes from symfony/browser-kit. (https://symfony.com/doc/current/testing.html#functional-tests)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace API\Tests\Controller; | |
| use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | |
| use Symfony\Component\HttpFoundation\Response; | |
| class APIWebTestCase extends WebTestCase | |
| { | |
| public function testEndpoint() | |
| { | |
| $client = static::createClient(); | |
| $client->request('GET', '/api/endpoint'); | |
| $this->assertSame(Response::HTTP_OK, $client->getResponse()->getStatusCode()); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment