Skip to content

Commit

Permalink
MDL-44822 assignfeedback_editpdf: Stop test generation in is_enabled()
Browse files Browse the repository at this point in the history
This change also moves one of the checks in test_gs_path. If
generateimage is false, there's no need to stat for the fixture file.
aolley committed Mar 26, 2014
1 parent 9b8555f commit 9f7674b
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions mod/assign/feedback/editpdf/classes/pdf.php
Original file line number Diff line number Diff line change
@@ -546,13 +546,13 @@ public static function test_gs_path($generateimage = true) {
return $ret;
}

$testfile = $CFG->dirroot.'/mod/assign/feedback/editpdf/tests/fixtures/testgs.pdf';
if (!file_exists($testfile)) {
$ret->status = self::GSPATH_NOTESTFILE;
if (!$generateimage) {
return $ret;
}

if (!$generateimage) {
$testfile = $CFG->dirroot.'/mod/assign/feedback/editpdf/tests/fixtures/testgs.pdf';
if (!file_exists($testfile)) {
$ret->status = self::GSPATH_NOTESTFILE;
return $ret;
}

2 changes: 1 addition & 1 deletion mod/assign/feedback/editpdf/locallib.php
Original file line number Diff line number Diff line change
@@ -265,7 +265,7 @@ public function delete_instance() {
* @return bool
*/
public function is_enabled() {
$testpath = assignfeedback_editpdf\pdf::test_gs_path();
$testpath = assignfeedback_editpdf\pdf::test_gs_path(false);
if ($testpath->status == assignfeedback_editpdf\pdf::GSPATH_OK) {
return true;
}

0 comments on commit 9f7674b

Please sign in to comment.