MDL-53461 assign: Unit test regex fix

This commit is contained in:
Andrew Nicols
2016-04-06 08:57:13 +08:00
parent 1b46b00f98
commit 10c227830e
+2 -2
View File
@@ -142,7 +142,7 @@ class mod_assign_external_testcase extends externallib_advanced_testcase {
* Test get_assignments
*/
public function test_get_assignments() {
global $DB, $USER;
global $DB, $USER, $CFG;
$this->resetAfterTest(true);
@@ -228,7 +228,7 @@ class mod_assign_external_testcase extends externallib_advanced_testcase {
$this->assertEquals('lightwork assignment', $assignment['name']);
$this->assertContains('the assignment intro text here', $assignment['intro']);
// Check the url of the file attatched.
$this->assertRegExp('/.*mod_assign\/intro\/intro\.txt.*/', $assignment['intro']);
$this->assertRegExp('@"' . $CFG->wwwroot . '/webservice/pluginfile.php/\d+/mod_assign/intro/intro\.txt"@', $assignment['intro']);
$this->assertEquals(1, $assignment['markingworkflow']);
$this->assertEquals(1, $assignment['markingallocation']);