Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. // tests/AppBundle/Controller/PostControllerTest.php
  2. namespace Tests\AppBundle\Controller;
  3.  
  4. use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
  5.  
  6. class PostControllerTest extends WebTestCase
  7. {
  8. public function testShowPost()
  9. {
  10. $mock = /** mocked version of the service with data relevant to this test**/
  11. $client = static::createClient(['app.externalapi' => $mock);
  12.  
  13. $crawler = $client->request('GET', '/post/hello-world');
  14.  
  15. $this->assertGreaterThan(
  16. 0,
  17. $crawler->filter('html:contains("Hello World")')->count()
  18. );
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement