diff options
Diffstat (limited to 'tests/unit/external')
-rw-r--r-- | tests/unit/external/NewsAPITest.php | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/tests/unit/external/NewsAPITest.php b/tests/unit/external/NewsAPITest.php index a14faafc7..0f3031090 100644 --- a/tests/unit/external/NewsAPITest.php +++ b/tests/unit/external/NewsAPITest.php @@ -66,9 +66,14 @@ class NewsAPITest extends ControllerTestUtility { $this->assertDefaultAnnotations('version'); } - public function testCleanUpAnnotations(){ + public function testBeforeUpdateAnnotations(){ $annotations = array('Ajax', 'CSRFExemption', 'API'); - $this->assertAnnotations($this->newsAPI, 'cleanUp', $annotations); + $this->assertAnnotations($this->newsAPI, 'beforeUpdate', $annotations); + } + + public function testAfterUpdateAnnotations(){ + $annotations = array('Ajax', 'CSRFExemption', 'API'); + $this->assertAnnotations($this->newsAPI, 'afterUpdate', $annotations); } public function testGetVersion(){ @@ -85,10 +90,18 @@ class NewsAPITest extends ControllerTestUtility { } - public function testCleanUp(){ + public function testBeforeUpdate(){ + $this->updater->expects($this->once()) + ->method('beforeUpdate'); + $response = $this->newsAPI->beforeUpdate(); + $this->assertTrue($response instanceof JSONResponse); + } + + + public function testAfterUpdate(){ $this->updater->expects($this->once()) - ->method('cleanUp'); - $response = $this->newsAPI->cleanUp(); + ->method('afterUpdate'); + $response = $this->newsAPI->afterUpdate(); $this->assertTrue($response instanceof JSONResponse); } |