diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2016-10-10 09:32:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-10 09:32:34 +0200 |
commit | a0cb8093423ef1384e8945235cd21b0c0e98f51f (patch) | |
tree | 28073dbd53154440284883db6d3480c20240d200 /tests | |
parent | e5fd9c1e1a97b9c5656b02fdb4bc1cb5f41f5280 (diff) | |
parent | c77933ca22bb7614f546bacbb62f22e2fa3074f5 (diff) | |
download | nextcloud-server-a0cb8093423ef1384e8945235cd21b0c0e98f51f.tar.gz nextcloud-server-a0cb8093423ef1384e8945235cd21b0c0e98f51f.zip |
Merge pull request #1660 from nextcloud/add-notification-icon-to-api
Add an icon to the notification API
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Notification/NotificationTest.php | 28 |
1 files changed, 28 insertions, 0 deletions
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); |