Skip to content
Snippets Groups Projects
Commit 73b977aa authored by Michael Grosse's avatar Michael Grosse Committed by Andreas Gohr
Browse files

Handle breaking class rename in PHPUnit 6.0

See for reference #1837 and sebastianbergmann/phpunit#2503
parent e3eb1d75
No related branches found
No related tags found
No related merge requests found
......@@ -97,11 +97,17 @@ class io_replaceinfile_test extends DokuWikiTest {
/**
* Test passing an invalid parameter.
*
* @expectedException PHPUnit\Framework\Error\Warning
*/
function test_badparam()
{
if (class_exists('PHPUnit\Framework\Error\Warning')) {
// PHPUnit 6
$this->expectException(PHPUnit\Framework\Error\Warning::class);
} else {
// PHPUnit 5
$this->expectException(PHPUnit_Framework_Error_Warning::class);
}
/* The empty $oldline parameter should be caught before the file doesn't exist test. */
$this->assertFalse(io_replaceInFile(TMP_DIR.'/not_existing_file.txt', '', '', false, 0));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment