3 namespace Tests\Wallabag\CoreBundle\Controller
;
5 use Tests\Wallabag\CoreBundle\WallabagCoreTestCase
;
6 use Wallabag\CoreBundle\Entity\Notification
;
8 class NotificationControllerTest
extends WallabagCoreTestCase
10 public function testDisplayNotification()
12 $this->logInAs('admin');
14 $client = $this->getClient();
16 $em = $client->getContainer()
17 ->get('doctrine.orm.entity_manager');
19 $notification = new Notification($this->getLoggedInUser());
20 $notification->setType(Notification
::TYPE_USER
)
21 ->setTitle('fooTitle')
22 ->setDescription('barDescription');
24 $em->persist($notification);
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());