<?php
class ExampleTest extends TestCase {
public function setUp()
{
parent::setUp();
DB::beginTransaction();
}
/**
* A basic functional test example.
*
* @return void
*/
public function testShowsPosts()
{
$title = 'Yay Great Post';
// "Create" post
Post::create(compact('title'));
$crawler = $this->client->request('GET', 'posts');
$this->assertEquals(
1,
count($crawler->filter("body:contains('{$title}')")),
"Expected to see the text '{$title}' within a body element."
);
}
}