summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-10-07 17:00:24 +0200
committerJoas Schilling <coding@schilljs.com>2016-10-07 17:00:24 +0200
commitc77933ca22bb7614f546bacbb62f22e2fa3074f5 (patch)
tree8af119a8b2c50c231e43f92b7b838bc0afa81efc /tests
parent7264d20152df326b82f5daebf26ee8e5161cb359 (diff)
downloadnextcloud-server-c77933ca22bb7614f546bacbb62f22e2fa3074f5.tar.gz
nextcloud-server-c77933ca22bb7614f546bacbb62f22e2fa3074f5.zip
Add an icon to the notification API
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Notification/NotificationTest.php28
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);