diff options
Diffstat (limited to 'tests/unit/controller/UtilityApiControllerTest.php')
-rw-r--r-- | tests/unit/controller/UtilityApiControllerTest.php | 19 |
1 files changed, 18 insertions, 1 deletions
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); + } + + } |