. * */ namespace OCA\News\Controller; use \OCA\AppFramework\Http\Request; use \OCA\AppFramework\Http\JSONResponse; use \OCA\AppFramework\Utility\ControllerTestUtility; use \OCA\AppFramework\Db\DoesNotExistException; use \OCA\AppFramework\Db\MultipleObjectsReturnedException; use \OCA\News\Db\Folder; require_once(__DIR__ . "/../classloader.php"); class FeedControllerTest extends ControllerTestUtility { private $api; private $bl; private $request; private $controller; /** * Gets run before each test */ public function setUp(){ $this->api = $this->getAPIMock(); $this->bl = $this->getMockBuilder('\OCA\News\Bl\FeedBl') ->disableOriginalConstructor() ->getMock(); $this->request = new Request(); $this->controller = new FeedController($this->api, $this->request, $this->bl); } private function assertFeedControllerAnnotations($methodName){ $annotations = array('IsAdminExemption', 'IsSubAdminExemption', 'Ajax'); $this->assertAnnotations($this->controller, $methodName, $annotations); } public function testFeedsAnnotations(){ $this->assertFeedControllerAnnotations('feeds'); } public function testActiveAnnotations(){ $this->assertFeedControllerAnnotations('active'); } public function testCreateAnnotations(){ $this->assertFeedControllerAnnotations('create'); } public function testDeleteAnnotations(){ $this->assertFeedControllerAnnotations('delete'); } public function testUpdateAnnotations(){ $this->assertFeedControllerAnnotations('update'); } public function testReadAnnotations(){ $this->assertFeedControllerAnnotations('read'); } public function testMoveAnnotations(){ $this->assertFeedControllerAnnotations('move'); } }