MDL-45221 Allow unit tests to pass under any OS
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 29 Apr 2014 17:22:54 +0000 (19:22 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 29 Apr 2014 17:22:54 +0000 (19:22 +0200)
This commit gets rid of the old lib/tests/other/executable.php
file completely because it was only executable under unix OSs
and moves the check to be performed against some mimetex binaries
that are known to be executable and bundled with every installation.

Note this was discovered because the weekly rolling process changed
the execution permissions of the "fixture" file and, at the end
we decided to get rid of it completely, folowing the plan above.

lib/tests/admintree_test.php
lib/tests/other/executable.php [deleted file]

index 623199f..82b5d17 100644 (file)
@@ -129,11 +129,16 @@ class core_admintree_testcase extends advanced_testcase {
         $this->assertRegexp('/class="patherror"/', $result);
 
         // Check for a file which is not executable.
-        $result = $executable->output_html($CFG->dirroot . '/config.php');
+        $result = $executable->output_html($CFG->dirroot . '/filter/tex/readme_moodle.txt');
         $this->assertRegexp('/class="patherror"/', $result);
 
         // Check for an executable file.
-        $result = $executable->output_html($CFG->dirroot . '/lib/tests/other/executable.php');
+        if ($CFG->ostype == 'WINDOWS') {
+            $filetocheck = 'mimetex.exe';
+        } else {
+            $filetocheck = 'mimetex.darwin';
+        }
+        $result = $executable->output_html($CFG->dirroot . '/filter/tex/' . $filetocheck);
         $this->assertRegexp('/class="pathok"/', $result);
 
         // Check for no file specified.
diff --git a/lib/tests/other/executable.php b/lib/tests/other/executable.php
deleted file mode 100644 (file)
index e69de29..0000000