summaryrefslogtreecommitdiffstats
path: root/tests/core
diff options
context:
space:
mode:
authorThomas Müller <DeepDiver1975@users.noreply.github.com>2016-04-12 12:49:11 +0200
committerThomas Müller <DeepDiver1975@users.noreply.github.com>2016-04-12 12:49:11 +0200
commitfdee771aca39f394c940edfcaa5a15826b078974 (patch)
tree400c956152f57c14bdfae094bbd3de265dd7baba /tests/core
parent276b8a583112203b9b71e4ac2b372e50ca62df9b (diff)
downloadnextcloud-server-fdee771aca39f394c940edfcaa5a15826b078974.tar.gz
nextcloud-server-fdee771aca39f394c940edfcaa5a15826b078974.zip
Add unit testing capabilities for templates (#23708)
Add unit testing capabilities for templates
Diffstat (limited to 'tests/core')
-rw-r--r--tests/core/templates/templates.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/core/templates/templates.php b/tests/core/templates/templates.php
new file mode 100644
index 00000000000..338d80b276c
--- /dev/null
+++ b/tests/core/templates/templates.php
@@ -0,0 +1,20 @@
+<?php
+
+namespace Tests\Core\Templates;
+
+class Templates extends \Test\TestCase {
+
+ public function test403() {
+ $template = \OC::$SERVERROOT . '/core/templates/403.php';
+ $expectedHtml = "<ul><li class='error'>\n\t\tAccess forbidden<br><p class='hint'></p></li></ul>";
+ $this->assertTemplate($expectedHtml, $template);
+ }
+
+ public function test404() {
+ $template = \OC::$SERVERROOT . '/core/templates/404.php';
+ $href = \OC::$server->getURLGenerator()->linkTo('', 'index.php');
+ $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 ownCloud.</a></p>\n\t\t</li></ul>";
+ $this->assertTemplate($expectedHtml, $template);
+ }
+
+}