diff options
Diffstat (limited to 'tests/unit/external/NewsAPITest.php')
-rw-r--r-- | tests/unit/external/NewsAPITest.php | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/unit/external/NewsAPITest.php b/tests/unit/external/NewsAPITest.php index e1fd2e50a..b5cd808e3 100644 --- a/tests/unit/external/NewsAPITest.php +++ b/tests/unit/external/NewsAPITest.php @@ -36,6 +36,7 @@ class NewsAPITest extends ControllerTestUtility { private $api; private $request; private $newsAPI; + private $updater; protected function setUp() { $this->api = $this->getMockBuilder( @@ -46,7 +47,11 @@ class NewsAPITest extends ControllerTestUtility { '\OCA\AppFramework\Http\Request') ->disableOriginalConstructor() ->getMock(); - $this->newsAPI = new NewsAPI($this->api, $this->request); + $this->updater = $this->getMockBuilder( + '\OCA\News\Utility\Updater') + ->disableOriginalConstructor() + ->getMock(); + $this->newsAPI = new NewsAPI($this->api, $this->request, $this->updater); } @@ -60,6 +65,10 @@ class NewsAPITest extends ControllerTestUtility { $this->assertDefaultAnnotations('version'); } + public function testCleanUpAnnotations(){ + $this->assertDefaultAnnotations('cleanUp'); + } + public function testGetVersion(){ $this->api->expects($this->once()) ->method('getAppValue') @@ -74,4 +83,11 @@ class NewsAPITest extends ControllerTestUtility { } + public function testCleanUp(){ + $this->updater->expects($this->once()) + ->method('cleanUp'); + $this->newsAPI->cleanUp(); + } + + } |