nextcloud-raw/tests/Unit/Controller/ PageControllerTest.php
32 lines
661 B

  1. <?php
  2. namespace OCA\Static\Tests\Unit\Controller;
  3. use PHPUnit_Framework_TestCase;
  4. use OCP\AppFramework\Http\TemplateResponse;
  5. use OCA\Static\Controller\PageController;
  6. class PageControllerTest extends PHPUnit_Framework_TestCase {
  7. private $controller;
  8. private $userId = 'john';
  9. public function setUp() {
  10. $request = $this->getMockBuilder('OCP\IRequest')->getMock();
  11. $this->controller = new PageController(
  12. 'static', $request, $this->userId
  13. );
  14. }
  15. public function testIndex() {
  16. $result = $this->controller->index();
  17. $this->assertEquals('index', $result->getTemplateName());
  18. $this->assertTrue($result instanceof TemplateResponse);
  19. }
  20. }