Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // tests/AppBundle/Controller/PostControllerTest.php
- namespace Tests\AppBundle\Controller;
- use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
- class PostControllerTest extends WebTestCase
- {
- public function testShowPost()
- {
- $mock = /** mocked version of the service with data relevant to this test**/
- $client = static::createClient(['app.externalapi' => $mock);
- $crawler = $client->request('GET', '/post/hello-world');
- $this->assertGreaterThan(
- 0,
- $crawler->filter('html:contains("Hello World")')->count()
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement