EventsControllerTest tests page heading and table with events are properly shown.

This commit is contained in:
Alexey Skobkin 2016-12-11 23:27:56 +03:00
parent 961b9f346a
commit 5cbc255331

View file

@ -0,0 +1,43 @@
<?php
namespace Skobkin\Bundle\PointToolsBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class EventsControllerTest extends WebTestCase
{
public function testHasHeading()
{
$client = static::createClient();
$crawler = $client->request('GET', '/events/last');
$this->assertEquals(
1,
$crawler->filter('.last-subscriptions-log h3')->count()
);
}
public function testHasEvents()
{
$client = static::createClient();
$crawler = $client->request('GET', '/events/last');
// Checking that we have events table
$this->assertEquals(
1,
$crawler->filter('.last-subscriptions-log table')->count(),
'Has no events table'
);
// Checking that we have at least one event in the table
$this->assertGreaterThan(
0,
$crawler->filter('.last-subscriptions-log table')->children()->filter('tbody')->children()->count(),
'No events shown in the table'
);
}
// @todo test pagination
}