diff --git a/lib/private/notification/action.php b/lib/private/notification/action.php index e1171531716ed86190c6e2e7d34f124df9ba3e53..958b085b38e8a0df99d4bcf25418d67adb5b9609 100644 --- a/lib/private/notification/action.php +++ b/lib/private/notification/action.php @@ -153,28 +153,6 @@ class Action implements IAction { return $this->requestType; } - /** - * @param string $icon - * @return $this - * @throws \InvalidArgumentException if the icon is invalid - * @since 8.2.0 - */ - public function setIcon($icon) { - if (!is_string($icon) || $icon === '' || isset($icon[64])) { - throw new \InvalidArgumentException('The given icon is invalid'); - } - $this->icon = $icon; - return $this; - } - - /** - * @return string - * @since 8.2.0 - */ - public function getIcon() { - return $this->icon; - } - /** * @return bool */ diff --git a/lib/private/notification/iaction.php b/lib/private/notification/iaction.php index 9fd964e3dcfc3dcdc6b089a4413fbd60a3c35e43..4aed2e9251761dd685e65ee8ee6db48eac9e8227 100644 --- a/lib/private/notification/iaction.php +++ b/lib/private/notification/iaction.php @@ -94,20 +94,6 @@ interface IAction { */ public function getRequestType(); - /** - * @param string $icon - * @return $this - * @throws \InvalidArgumentException if the icon is invalid - * @since 8.2.0 - */ - public function setIcon($icon); - - /** - * @return string - * @since 8.2.0 - */ - public function getIcon(); - /** * @return bool * @since 8.2.0 diff --git a/lib/private/notification/inotification.php b/lib/private/notification/inotification.php index faf5db1d24c75a111f06f4eef0f577e2db8790b7..a8bf5b110ab77ccafa40bebe5cf02733d435a7a5 100644 --- a/lib/private/notification/inotification.php +++ b/lib/private/notification/inotification.php @@ -179,20 +179,6 @@ interface INotification { */ public function getLink(); - /** - * @param string $icon - * @return $this - * @throws \InvalidArgumentException if the icon are invalid - * @since 8.2.0 - */ - public function setIcon($icon); - - /** - * @return string - * @since 8.2.0 - */ - public function getIcon(); - /** * @return IAction * @since 8.2.0 diff --git a/lib/private/notification/notification.php b/lib/private/notification/notification.php index 15ca0fee5d20eed803b2b770ca9b880747271e80..01df659d4a17b946a7123a3499c48347fcb9834c 100644 --- a/lib/private/notification/notification.php +++ b/lib/private/notification/notification.php @@ -335,28 +335,6 @@ class Notification implements INotification { return $this->link; } - /** - * @param string $icon - * @return $this - * @throws \InvalidArgumentException if the icon are invalid - * @since 8.2.0 - */ - public function setIcon($icon) { - if (!is_string($icon) || $icon === '' || isset($icon[64])) { - throw new \InvalidArgumentException('The given icon is invalid'); - } - $this->icon = $icon; - return $this; - } - - /** - * @return string - * @since 8.2.0 - */ - public function getIcon() { - return $this->icon; - } - /** * @return IAction * @since 8.2.0 diff --git a/tests/lib/notification/actiontest.php b/tests/lib/notification/actiontest.php index e319c250cc77ae23d7b0a2bf898b138f0c1680dc..a6157d6c56e42699d108f997417721cf38e002be 100644 --- a/tests/lib/notification/actiontest.php +++ b/tests/lib/notification/actiontest.php @@ -171,47 +171,6 @@ class ActionTest extends TestCase { $this->action->setLink($link, $type); } - public function dataSetIcon() { - return [ - ['test1'], - [str_repeat('a', 1)], - [str_repeat('a', 64)], - ]; - } - - /** - * @dataProvider dataSetIcon - * @param string $icon - */ - public function testSetIcon($icon) { - $this->assertSame('', $this->action->getIcon()); - $this->action->setIcon($icon); - $this->assertSame($icon, $this->action->getIcon()); - } - - public function dataSetIconInvalid() { - return [ - [true], - [false], - [0], - [1], - [''], - [str_repeat('a', 65)], - [[]], - [[str_repeat('a', 65)]], - ]; - } - - /** - * @dataProvider dataSetIconInvalid - * @param string $icon - * - * @expectedException \InvalidArgumentException - */ - public function testSetIconInvalid($icon) { - $this->action->setIcon($icon); - } - public function testIsValid() { $this->assertFalse($this->action->isValid()); $this->assertFalse($this->action->isValidParsed()); diff --git a/tests/lib/notification/notificationtest.php b/tests/lib/notification/notificationtest.php index 98dc0e5bacd15a5fd322a35b12f4549dc6bbb3b8..8be49ebdc177a6b534d58627742c2030df1db985 100644 --- a/tests/lib/notification/notificationtest.php +++ b/tests/lib/notification/notificationtest.php @@ -371,34 +371,6 @@ class NotificationTest extends TestCase { $this->notification->setLink($link); } - public function dataSetIcon() { - return $this->dataValidString(64); - } - - /** - * @dataProvider dataSetIcon - * @param string $icon - */ - public function testSetIcon($icon) { - $this->assertSame('', $this->notification->getIcon()); - $this->notification->setIcon($icon); - $this->assertSame($icon, $this->notification->getIcon()); - } - - public function dataSetIconInvalid() { - return $this->dataInvalidString(64); - } - - /** - * @dataProvider dataSetIconInvalid - * @param mixed $icon - * - * @expectedException \InvalidArgumentException - */ - public function testSetIconInvalid($icon) { - $this->notification->setIcon($icon); - } - public function testCreateAction() { $action = $this->notification->createAction(); $this->assertInstanceOf('OC\Notification\IAction', $action);