Skip to content
Snippets Groups Projects
Commit bd3cb3d5 authored by Andreas Gohr's avatar Andreas Gohr
Browse files

make use of exception wrapper in io test

parent 01ef6ea2
No related branches found
No related tags found
No related merge requests found
......@@ -101,12 +101,11 @@ class io_replaceinfile_test extends DokuWikiTest {
function test_badparam()
{
if (class_exists('PHPUnit\Framework\Error\Warning')) {
// PHPUnit 6
$this->expectException(PHPUnit\Framework\Error\Warning::class);
$expect = PHPUnit\Framework\Error\Warning::class; // PHPUnit 6
} else {
// PHPUnit 5
$this->expectException(PHPUnit_Framework_Error_Warning::class);
$expect = PHPUnit_Framework_Error_Warning::class; // PHPUnit 5
}
$this->setExpectedException($expect);
/* 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