. * */ namespace OCA\News\Controller; use \OCP\IRequest; use \OCP\AppFramework\Http\TemplateResponse; use \OCA\News\Utility\ControllerTestUtility; require_once(__DIR__ . "/../../classloader.php"); class PageControllerTest extends ControllerTestUtility { private $api; private $request; private $controller; /** * Gets run before each test */ public function setUp(){ $this->api = $this->getAPIMock(); $this->request = $this->getRequest(); $this->controller = new PageController($this->api, $this->request); } public function testOpmlAnnotations(){ $annotations = array('IsAdminExemption', 'IsSubAdminExemption', 'CSRFExemption'); $this->assertAnnotations($this->controller, 'index', $annotations); } public function testIndex(){ $response = $this->controller->index(); $this->assertEquals('main', $response->getTemplateName()); $this->assertTrue($response instanceof TemplateResponse); } }