Commit 890c2603 authored by Damyon Wiese's avatar Damyon Wiese Committed by Dan Poltawski
Browse files

MDL-55071 phpunit: Fix failing tests due to changes in default output

Part of MDL-55071
parent 2ede86d7
......@@ -143,7 +143,8 @@ class core_admintree_testcase extends advanced_testcase {
// Check for no file specified.
$result = $executable->output_html('');
$this->assertRegexp('/name="s__test1" value=""/', $result);
$this->assertRegexp('/name="s__test1"/', $result);
$this->assertRegexp('/value=""/', $result);
}
/**
......
......@@ -69,7 +69,7 @@ class core_outputrequirementslib_testcase extends advanced_testcase {
* Test to make sure that backslashes are not generated with either slasharguments set to on or off.
*/
public function test_jquery_plugin() {
global $CFG;
global $CFG, $PAGE;
$this->resetAfterTest();
......@@ -83,7 +83,8 @@ class core_outputrequirementslib_testcase extends advanced_testcase {
$this->assertTrue($requirements->jquery_plugin('ui'));
// Get the code containing the required jquery plugins.
$requirecode = $requirements->get_top_of_body_code();
$renderer = $PAGE->get_renderer('core', NULL, RENDERER_TARGET_MAINTENANCE);
$requirecode = $requirements->get_top_of_body_code($renderer);
// Make sure that the generated code does not contain backslashes.
$this->assertFalse(strpos($requirecode, '\\'), "Output contains backslashes: " . $requirecode);
......@@ -97,7 +98,7 @@ class core_outputrequirementslib_testcase extends advanced_testcase {
$this->assertTrue($requirements->jquery_plugin('ui'));
// Get the code containing the required jquery plugins.
$requirecode = $requirements->get_top_of_body_code();
$requirecode = $requirements->get_top_of_body_code($renderer);
// Make sure that the generated code does not contain backslashes.
$this->assertFalse(strpos($requirecode, '\\'), "Output contains backslashes: " . $requirecode);
}
......
......@@ -93,7 +93,7 @@ test
$dividercount += 2;
// The basic entry count will additionally include the wrapper menu, Dashboard, Profile, and the Logout link.
$entrycount += 4;
$entrycount += 3;
$output = $OUTPUT->user_menu($USER);
preg_match_all('/<a [^>]+role="menuitem"[^>]+>/', $output, $results);
......
......@@ -315,7 +315,7 @@ class mod_assign_locallib_testcase extends mod_assign_base_testcase {
$this->assertContains(get_string('overdue', 'assign', format_time(4 * 24 * 60 * 60 + $difftime)), $output);
$document = new DOMDocument();
$document->loadHTML($output);
@$document->loadHTML($output);
$xpath = new DOMXPath($document);
$this->assertEquals('', $xpath->evaluate('string(//td[@id="mod_assign_grading_r0_c8"])'));
}
......@@ -359,7 +359,7 @@ class mod_assign_locallib_testcase extends mod_assign_base_testcase {
$gradingtable = new assign_grading_table($assign, 4, '', 0, true);
$output = $assign->get_renderer()->render($gradingtable);
$document = new DOMDocument();
$document->loadHTML($output);
@$document->loadHTML($output);
$xpath = new DOMXPath($document);
// Check status.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment