TemplatesTest.php 790 B

123456789101112131415161718192021
  1. <?php
  2. namespace Tests\Core\Templates;
  3. class TemplatesTest extends \Test\TestCase {
  4. public function test403() {
  5. $template = \OC::$SERVERROOT . '/core/templates/403.php';
  6. $expectedHtml = "<ul><li class='error'>\n\t\tAccess forbidden<br><p class='hint'></p></li></ul>";
  7. $this->assertTemplate($expectedHtml, $template);
  8. }
  9. public function test404() {
  10. $template = \OC::$SERVERROOT . '/core/templates/404.php';
  11. $href = \OC::$server->getURLGenerator()->linkTo('', 'index.php');
  12. $expectedHtml = "<ul><li class='error'>\n\t\t\tFile not found<br><p class='hint'>The specified document has not been found on the server.</p>\n<p class='hint'><a href='$href'>You can click here to return to Nextcloud.</a></p>\n\t\t</li></ul>";
  13. $this->assertTemplate($expectedHtml, $template);
  14. }
  15. }