From f500ff4e52776984da36533706b31937a91cbe40 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Tue, 29 Apr 2014 19:22:54 +0200 Subject: [PATCH] MDL-45221 Allow unit tests to pass under any OS 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 | 9 +++++++-- lib/tests/other/executable.php | 0 2 files changed, 7 insertions(+), 2 deletions(-) delete mode 100644 lib/tests/other/executable.php diff --git a/lib/tests/admintree_test.php b/lib/tests/admintree_test.php index 623199f6cc0..82b5d177f54 100644 --- a/lib/tests/admintree_test.php +++ b/lib/tests/admintree_test.php @@ -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 index e69de29bb2d..00000000000