Skip to content

Instantly share code, notes, and snippets.

@ger86
Created April 23, 2019 08:12
Show Gist options
  • Save ger86/d0d7cae1236f02bc9f6cb6231da77817 to your computer and use it in GitHub Desktop.
Save ger86/d0d7cae1236f02bc9f6cb6231da77817 to your computer and use it in GitHub Desktop.
<?php
namespace App\Tests;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class BlogPostsControllerTest extends WebTestCase {
public function testShowPost() {
$client = static::createClient();
$client->followRedirects();
$crawler = $client->request('GET', 'blog');
$this->assertSame('My awesome blog', $crawler->filter('h1')->text());
$this->assertEquals(1, $crawler->filter('.container .posts')->count());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment