]>
Commit | Line | Data |
---|---|---|
e0f9010e TC |
1 | <?php |
2 | ||
3 | namespace Tests\Wallabag\CoreBundle\Controller; | |
4 | ||
5 | use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; | |
6 | use Wallabag\CoreBundle\Entity\Notification; | |
7 | ||
8 | class NotificationControllerTest extends WallabagCoreTestCase | |
9 | { | |
10 | public function testDisplayNotification() | |
11 | { | |
12 | $this->logInAs('admin'); | |
13 | ||
14 | $client = $this->getClient(); | |
15 | ||
16 | $em = $client->getContainer() | |
17 | ->get('doctrine.orm.entity_manager'); | |
18 | ||
19 | $notification = new Notification($this->getLoggedInUser()); | |
20 | $notification->setType(Notification::TYPE_USER) | |
21 | ->setTitle('fooTitle') | |
22 | ->setDescription('barDescription'); | |
23 | ||
24 | $em->persist($notification); | |
25 | $em->flush(); | |
26 | ||
27 | $crawler = $client->request('GET', '/'); | |
28 | $this->assertCount(1, $notificationArea = $crawler->filter('.notifications-area .collection')); | |
29 | $this->assertContains('fooTitle', $notificationArea->text()); | |
30 | $this->assertContains('barDescription', $notificationArea->text()); | |
31 | } | |
32 | } |