From 816a8beb0b77164aa60a7fe23b4b3d0881985be3 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Tue, 17 Feb 2015 15:17:40 +0100 Subject: add status api route --- tests/unit/controller/UtilityApiControllerTest.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'tests/unit/controller/UtilityApiControllerTest.php') diff --git a/tests/unit/controller/UtilityApiControllerTest.php b/tests/unit/controller/UtilityApiControllerTest.php index f4219fddf..292b8d16a 100644 --- a/tests/unit/controller/UtilityApiControllerTest.php +++ b/tests/unit/controller/UtilityApiControllerTest.php @@ -21,6 +21,7 @@ class UtilityApiControllerTest extends \PHPUnit_Framework_TestCase { private $newsAPI; private $updater; private $appName; + private $status; protected function setUp() { $this->appName = 'news'; @@ -36,8 +37,13 @@ class UtilityApiControllerTest extends \PHPUnit_Framework_TestCase { '\OCA\News\Utility\Updater') ->disableOriginalConstructor() ->getMock(); + $this->status = $this->getMockBuilder( + '\OCA\News\Service\StatusService') + ->disableOriginalConstructor() + ->getMock(); $this->newsAPI = new UtilityApiController( - $this->appName, $this->request, $this->updater, $this->settings + $this->appName, $this->request, $this->updater, $this->settings, + $this->status ); } @@ -70,4 +76,15 @@ class UtilityApiControllerTest extends \PHPUnit_Framework_TestCase { } + public function testStatus(){ + $in = 'hi'; + $this->status->expects($this->once()) + ->method('getStatus') + ->will($this->returnValue($in)); + $result = $this->newsAPI->status(); + + $this->assertEquals($in, $result); + } + + } -- cgit v1.2.3