summaryrefslogtreecommitdiffstats
path: root/tests/lib/notification/actiontest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/notification/actiontest.php')
-rw-r--r--tests/lib/notification/actiontest.php49
1 files changed, 23 insertions, 26 deletions
diff --git a/tests/lib/notification/actiontest.php b/tests/lib/notification/actiontest.php
index e319c250cc7..0044df82cd1 100644
--- a/tests/lib/notification/actiontest.php
+++ b/tests/lib/notification/actiontest.php
@@ -49,7 +49,7 @@ class ActionTest extends TestCase {
*/
public function testSetLabel($label) {
$this->assertSame('', $this->action->getLabel());
- $this->action->setLabel($label);
+ $this->assertSame($this->action, $this->action->setLabel($label));
$this->assertSame($label, $this->action->getLabel());
}
@@ -68,7 +68,7 @@ class ActionTest extends TestCase {
/**
* @dataProvider dataSetLabelInvalid
- * @param string $label
+ * @param mixed $label
*
* @expectedException \InvalidArgumentException
*/
@@ -90,7 +90,7 @@ class ActionTest extends TestCase {
*/
public function testSetParsedLabel($label) {
$this->assertSame('', $this->action->getParsedLabel());
- $this->action->setParsedLabel($label);
+ $this->assertSame($this->action, $this->action->setParsedLabel($label));
$this->assertSame($label, $this->action->getParsedLabel());
}
@@ -108,7 +108,7 @@ class ActionTest extends TestCase {
/**
* @dataProvider dataSetParsedLabelInvalid
- * @param string $label
+ * @param mixed $label
*
* @expectedException \InvalidArgumentException
*/
@@ -132,7 +132,7 @@ class ActionTest extends TestCase {
*/
public function testSetLink($link, $type) {
$this->assertSame('', $this->action->getLink());
- $this->action->setLink($link, $type);
+ $this->assertSame($this->action, $this->action->setLink($link, $type));
$this->assertSame($link, $this->action->getLink());
$this->assertSame($type, $this->action->getRequestType());
}
@@ -162,8 +162,8 @@ class ActionTest extends TestCase {
/**
* @dataProvider dataSetLinkInvalid
- * @param string $link
- * @param string $type
+ * @param mixed $link
+ * @param mixed $type
*
* @expectedException \InvalidArgumentException
*/
@@ -171,45 +171,42 @@ class ActionTest extends TestCase {
$this->action->setLink($link, $type);
}
- public function dataSetIcon() {
+ public function dataSetPrimary() {
return [
- ['test1'],
- [str_repeat('a', 1)],
- [str_repeat('a', 64)],
+ [true],
+ [false],
];
}
/**
- * @dataProvider dataSetIcon
- * @param string $icon
+ * @dataProvider dataSetPrimary
+ * @param bool $primary
*/
- public function testSetIcon($icon) {
- $this->assertSame('', $this->action->getIcon());
- $this->action->setIcon($icon);
- $this->assertSame($icon, $this->action->getIcon());
+ public function testSetPrimary($primary) {
+ $this->assertSame(false, $this->action->isPrimary());
+ $this->assertSame($this->action, $this->action->setPrimary($primary));
+ $this->assertSame($primary, $this->action->isPrimary());
}
- public function dataSetIconInvalid() {
+ public function dataSetPrimaryInvalid() {
return [
- [true],
- [false],
[0],
[1],
[''],
- [str_repeat('a', 65)],
+ [str_repeat('a', 257)],
[[]],
- [[str_repeat('a', 65)]],
+ [[str_repeat('a', 257)]],
];
}
/**
- * @dataProvider dataSetIconInvalid
- * @param string $icon
+ * @dataProvider dataSetPrimaryInvalid
+ * @param mixed $primary
*
* @expectedException \InvalidArgumentException
*/
- public function testSetIconInvalid($icon) {
- $this->action->setIcon($icon);
+ public function testSetPrimaryInvalid($primary) {
+ $this->action->setPrimary($primary);
}
public function testIsValid() {