Configure test fixtures and implement conference page functional test
This commit is contained in:
@@ -14,4 +14,34 @@ class ConferenceControllerTest extends WebTestCase
|
||||
$this->assertResponseIsSuccessful();
|
||||
$this->assertSelectorTextContains('h2', 'Give your feedback');
|
||||
}
|
||||
|
||||
public function testConferencePage()
|
||||
{
|
||||
$client = static::createClient();
|
||||
$crawler = $client->request('GET', '/');
|
||||
|
||||
$this->assertCount(2, $crawler->filter('h4'));
|
||||
|
||||
$client->clickLink('View');
|
||||
|
||||
$this->assertPageTitleContains('Amsterdam');
|
||||
$this->assertResponseIsSuccessful();
|
||||
$this->assertSelectorTextContains('h2', 'Amsterdam 2019');
|
||||
$this->assertSelectorExists('div:contains("There are 1 comments")');
|
||||
}
|
||||
|
||||
public function testCommentSubmission()
|
||||
{
|
||||
$client = static::createClient();
|
||||
$client->request('GET', 'conference/amsterdam-2019');
|
||||
$client->submitForm('Submit', [
|
||||
'comment[author]' => 'Bob',
|
||||
'comment[text]' => 'Some feedback from an automated functional test',
|
||||
'comment[email]' => 'test@example.com',
|
||||
'comment[photo]' => dirname(__DIR__, 2) . '/public/images/under-construction.gif',
|
||||
]);
|
||||
$this->assertResponseRedirects();
|
||||
$client->followRedirect();
|
||||
$this->assertSelectorExists('div:contains("There are 2 comments")');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user