diff options
Diffstat (limited to 'tests/Wallabag/CoreBundle/Controller/NotificationControllerTest.php')
-rw-r--r-- | tests/Wallabag/CoreBundle/Controller/NotificationControllerTest.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/Wallabag/CoreBundle/Controller/NotificationControllerTest.php b/tests/Wallabag/CoreBundle/Controller/NotificationControllerTest.php new file mode 100644 index 00000000..e92528ca --- /dev/null +++ b/tests/Wallabag/CoreBundle/Controller/NotificationControllerTest.php | |||
@@ -0,0 +1,32 @@ | |||
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 | } | ||