From c77933ca22bb7614f546bacbb62f22e2fa3074f5 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 7 Oct 2016 17:00:24 +0200 Subject: Add an icon to the notification API Signed-off-by: Joas Schilling --- tests/lib/Notification/NotificationTest.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'tests') diff --git a/tests/lib/Notification/NotificationTest.php b/tests/lib/Notification/NotificationTest.php index 93d48dfd604..77d9e989cf1 100644 --- a/tests/lib/Notification/NotificationTest.php +++ b/tests/lib/Notification/NotificationTest.php @@ -386,6 +386,34 @@ class NotificationTest extends TestCase { $this->notification->setLink($link); } + public function dataSetIcon() { + return $this->dataValidString(4000); + } + + /** + * @dataProvider dataSetIcon + * @param string $icon + */ + public function testSetIcon($icon) { + $this->assertSame('', $this->notification->getIcon()); + $this->assertSame($this->notification, $this->notification->setIcon($icon)); + $this->assertSame($icon, $this->notification->getIcon()); + } + + public function dataSetIconInvalid() { + return $this->dataInvalidString(4000); + } + + /** + * @dataProvider dataSetIconInvalid + * @param mixed $icon + * + * @expectedException \InvalidArgumentException + */ + public function testSetIconInvalid($icon) { + $this->notification->setIcon($icon); + } + public function testCreateAction() { $action = $this->notification->createAction(); $this->assertInstanceOf('OCP\Notification\IAction', $action); -- cgit v1.2.3