diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2015-11-17 11:08:53 +0300 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2015-11-17 11:08:53 +0300 |
commit | 64bb24d9a391b3c14ac33d926fe33e52f218c178 (patch) | |
tree | a9c0db56ee1a8f5a15fb3f391889139ca2f2a013 /tests | |
parent | 8b95a5743927692be5f5a4553fda340805ddb469 (diff) |
Support primary instead of icon
Diffstat (limited to 'tests')
-rw-r--r-- | tests/controller/EndpointControllerTest.php | 12 | ||||
-rw-r--r-- | tests/lib/HandlerTest.php | 8 |
2 files changed, 11 insertions, 9 deletions
diff --git a/tests/controller/EndpointControllerTest.php b/tests/controller/EndpointControllerTest.php index b85e401..ae4e063 100644 --- a/tests/controller/EndpointControllerTest.php +++ b/tests/controller/EndpointControllerTest.php @@ -483,8 +483,8 @@ class EndpointControllerTest extends TestCase { public function dataActionToArray() { return [ - ['label1', 'link1', 'GET'], - ['label2', 'link2', 'POST'], + ['label1', 'link1', 'GET', false], + ['label2', 'link2', 'POST', true], ]; } @@ -494,8 +494,9 @@ class EndpointControllerTest extends TestCase { * @param string $label * @param string $link * @param string $requestType + * @param bool $isPrimary */ - public function testActionToArray($label, $link, $requestType) { + public function testActionToArray($label, $link, $requestType, $isPrimary) { $action = $this->getMockBuilder('OC\Notification\IAction') ->disableOriginalConstructor() ->getMock(); @@ -512,10 +513,15 @@ class EndpointControllerTest extends TestCase { ->method('getRequestType') ->willReturn($requestType); + $action->expects($this->once()) + ->method('isPrimary') + ->willReturn($isPrimary); + $this->assertEquals([ 'label' => $label, 'link' => $link, 'type' => $requestType, + 'primary' => $isPrimary, ], $this->invokePrivate($this->getController(), 'actionToArray', [$action]) ); diff --git a/tests/lib/HandlerTest.php b/tests/lib/HandlerTest.php index fe472ea..9cd219d 100644 --- a/tests/lib/HandlerTest.php +++ b/tests/lib/HandlerTest.php @@ -54,13 +54,12 @@ class HandlerTest extends TestCase { 'getMessage' => 'message', 'getMessageParameters' => [], 'getLink' => 'link', - 'getIcon' => 'icon', 'getActions' => [ [ 'getLabel' => 'action_label', - 'getIcon' => 'action_icon', 'getLink' => 'action_link', 'getRequestType' => 'GET', + 'isPrimary' => false, ] ], ]); @@ -110,13 +109,12 @@ class HandlerTest extends TestCase { 'getMessage' => 'message', 'getMessageParameters' => [], 'getLink' => 'link', - 'getIcon' => 'icon', 'getActions' => [ [ 'getLabel' => 'action_label', - 'getIcon' => 'action_icon', 'getLink' => 'action_link', 'getRequestType' => 'GET', + 'isPrimary' => true, ] ], ]); @@ -201,7 +199,6 @@ class HandlerTest extends TestCase { 'getMessage' => '', 'getMessageParameters' => [], 'getLink' => '', - 'getIcon' => '', 'getActions' => [], ]; foreach ($defaultValues as $method => $returnValue) { @@ -222,7 +219,6 @@ class HandlerTest extends TestCase { 'setSubject', 'setMessage', 'setLink', - 'setIcon', 'addAction', ]; foreach ($defaultValues as $method) { |