Created
June 27, 2017 07:00
-
-
Save emil-nasso/2a37ceb9a88500a84928a03422fff1c0 to your computer and use it in GitHub Desktop.
This file contains 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
// 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() | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment