diff --git a/cache/tests/cache_test.php b/cache/tests/cache_test.php index f252b4c01dc..3eb6fd8b9a7 100644 --- a/cache/tests/cache_test.php +++ b/cache/tests/cache_test.php @@ -1321,7 +1321,7 @@ class core_cache_testcase extends advanced_testcase { // The config file will not exist yet as we've not done anything with the cache. // reset_all_data removes the file and without a call to create a configuration it doesn't exist // as yet. - $this->assertFileNotExists($configfile); + $this->assertFileDoesNotExist($configfile); // Disable the cache cache_phpunit_factory::phpunit_disable(); diff --git a/lib/antivirus/clamav/tests/scanner_test.php b/lib/antivirus/clamav/tests/scanner_test.php index 4a2eca7a10a..fb57b69114c 100644 --- a/lib/antivirus/clamav/tests/scanner_test.php +++ b/lib/antivirus/clamav/tests/scanner_test.php @@ -49,7 +49,7 @@ class antivirus_clamav_scanner_testcase extends advanced_testcase { // Test specifying file that does not exist. $nonexistingfile = $this->tempfile . '_'; - $this->assertFileNotExists($nonexistingfile); + $this->assertFileDoesNotExist($nonexistingfile); // Run mock scanning, we expect SCAN_RESULT_ERROR. $this->assertEquals(2, $antivirus->scan_file($nonexistingfile, '')); $this->assertDebuggingCalled(); @@ -263,7 +263,7 @@ class antivirus_clamav_scanner_testcase extends advanced_testcase { $this->expectException(\core\antivirus\scanner_exception::class); $antivirus->scan_file($this->tempfile, ''); $this->assertEquals('antivirusfailed', $this->getExpectedExceptionCode()); - $this->assertFileNotExists($this->tempfile); + $this->assertFileDoesNotExist($this->tempfile); } public function test_scan_data_no_virus() { diff --git a/lib/filestorage/tests/file_storage_test.php b/lib/filestorage/tests/file_storage_test.php index 3134458af96..15d88dcb65f 100644 --- a/lib/filestorage/tests/file_storage_test.php +++ b/lib/filestorage/tests/file_storage_test.php @@ -86,7 +86,7 @@ class core_files_file_storage_testcase extends advanced_testcase { // Tests that missing content file is recreated. unlink($location); - $this->assertFileNotExists($location); + $this->assertFileDoesNotExist($location); $filerecord['filename'] = 'testfile2.txt'; $file2 = $fs->create_file_from_string($filerecord, $content); @@ -158,7 +158,7 @@ class core_files_file_storage_testcase extends advanced_testcase { // Tests that missing content file is recreated. unlink($location); - $this->assertFileNotExists($location); + $this->assertFileDoesNotExist($location); $filerecord['filename'] = 'testfile2.jpg'; $file2 = $fs->create_file_from_pathname($filerecord, $filepath); diff --git a/lib/filestorage/tests/zip_packer_test.php b/lib/filestorage/tests/zip_packer_test.php index b9c8bba9378..b6452d4b6d1 100644 --- a/lib/filestorage/tests/zip_packer_test.php +++ b/lib/filestorage/tests/zip_packer_test.php @@ -143,7 +143,7 @@ class core_files_zip_packer_testcase extends advanced_testcase implements file_p $packer = get_file_packer('application/zip'); $archive = "$CFG->tempdir/archive.zip"; - $this->assertFileNotExists($archive); + $this->assertFileDoesNotExist($archive); $result = $packer->archive_to_pathname($this->files, $archive); $this->assertTrue($result); $this->assertFileExists($archive); @@ -157,15 +157,15 @@ class core_files_zip_packer_testcase extends advanced_testcase implements file_p // Test invalid files parameter. $archive = "$CFG->tempdir/archive2.zip"; - $this->assertFileNotExists($archive); + $this->assertFileDoesNotExist($archive); - $this->assertFileNotExists(__DIR__.'/xx/yy/ee.txt'); + $this->assertFileDoesNotExist(__DIR__.'/xx/yy/ee.txt'); $files = array('xtest.txt'=>__DIR__.'/xx/yy/ee.txt'); $result = $packer->archive_to_pathname($files, $archive, false); $this->assertFalse($result); $this->assertDebuggingCalled(); - $this->assertFileNotExists($archive); + $this->assertFileDoesNotExist($archive); $result = $packer->archive_to_pathname($files, $archive); $this->assertTrue($result); @@ -175,7 +175,7 @@ class core_files_zip_packer_testcase extends advanced_testcase implements file_p $this->assertSame(array(), $archivefiles); unlink($archive); - $this->assertFileNotExists(__DIR__.'/xx/yy/ee.txt'); + $this->assertFileDoesNotExist(__DIR__.'/xx/yy/ee.txt'); $this->assertFileExists(__DIR__.'/fixtures/test.txt'); $files = array('xtest.txt'=>__DIR__.'/xx/yy/ee.txt', 'test.txt'=>__DIR__.'/fixtures/test.txt', 'ytest.txt'=>__DIR__.'/xx/yy/yy.txt'); $result = $packer->archive_to_pathname($files, $archive); @@ -338,7 +338,7 @@ class core_files_zip_packer_testcase extends advanced_testcase implements file_p } foreach ($donotextract as $file) { $this->assertFalse(isset($result[$file])); - $this->assertFileNotExists($target.$file); + $this->assertFileDoesNotExist($target.$file); } } @@ -429,7 +429,7 @@ class core_files_zip_packer_testcase extends advanced_testcase implements file_p $packer = get_file_packer('application/zip'); $archive = "$CFG->tempdir/archive.zip"; - $this->assertFileNotExists($archive); + $this->assertFileDoesNotExist($archive); $packer->archive_to_pathname(array(), $archive); $this->assertFileExists($archive); @@ -469,7 +469,7 @@ class core_files_zip_packer_testcase extends advanced_testcase implements file_p $textfile = "$CFG->tempdir/textfile.txt"; touch($textfile); - $this->assertFileNotExists($archive); + $this->assertFileDoesNotExist($archive); $this->assertFileExists($textfile); // Create archive and close it without files. @@ -524,7 +524,7 @@ class core_files_zip_packer_testcase extends advanced_testcase implements file_p $this->assertInstanceOf('PHPUnit\Framework\ExpectationFailedException', $e); $this->assertTrue($result); } - $this->assertFileNotExists($archive); + $this->assertFileDoesNotExist($archive); } /** @@ -537,7 +537,7 @@ class core_files_zip_packer_testcase extends advanced_testcase implements file_p $archive = "$CFG->tempdir/archive.zip"; - $this->assertFileNotExists($archive); + $this->assertFileDoesNotExist($archive); $zip_archive = new zip_archive(); $result = $zip_archive->open($archive, file_archive::OPEN); diff --git a/lib/tests/antivirus_test.php b/lib/tests/antivirus_test.php index d8b0c684b0e..ba1ee00d11b 100644 --- a/lib/tests/antivirus_test.php +++ b/lib/tests/antivirus_test.php @@ -82,7 +82,7 @@ class core_antivirus_testcase extends advanced_testcase { $this->expectException(\core\antivirus\scanner_exception::class); $this->assertEmpty(\core\antivirus\manager::scan_file($this->tempfile, 'FOUND', true)); // File expected to be deleted. - $this->assertFileNotExists($this->tempfile); + $this->assertFileDoesNotExist($this->tempfile); } public function test_manager_send_message_to_user_email_scan_file_virus() { diff --git a/lib/tests/component_test.php b/lib/tests/component_test.php index 4a3bb07c316..31f005a63d9 100644 --- a/lib/tests/component_test.php +++ b/lib/tests/component_test.php @@ -419,7 +419,7 @@ class core_component_testcase extends advanced_testcase { // Any plugin without subtypes is ok here. $this->assertFileExists("$CFG->dirroot/mod/choice"); - $this->assertFileNotExists("$CFG->dirroot/mod/choice/db/subplugins.json"); + $this->assertFileDoesNotExist("$CFG->dirroot/mod/choice/db/subplugins.json"); $this->assertNull(core_component::get_subplugins('mod_choice')); diff --git a/lib/tests/filterlib_test.php b/lib/tests/filterlib_test.php index 62719022a31..58af8062839 100644 --- a/lib/tests/filterlib_test.php +++ b/lib/tests/filterlib_test.php @@ -704,7 +704,7 @@ class core_filterlib_testcase extends advanced_testcase { $this->assertFileExists("$CFG->dirroot/filter/emailprotect"); // Any standard filter. $this->assertFileExists("$CFG->dirroot/filter/tidy"); // Any standard filter. - $this->assertFileNotExists("$CFG->dirroot/filter/grgrggr"); // Any non-existent filter + $this->assertFileDoesNotExist("$CFG->dirroot/filter/grgrggr"); // Any non-existent filter // Setup fixture. set_config('filterall', 0); diff --git a/lib/tests/plugin_manager_test.php b/lib/tests/plugin_manager_test.php index 1801a6127ae..9fc18a6a067 100644 --- a/lib/tests/plugin_manager_test.php +++ b/lib/tests/plugin_manager_test.php @@ -251,8 +251,8 @@ class core_plugin_manager_testcase extends advanced_testcase { $this->assertFileExists("$CFG->dirroot/mod/assign", 'assign module is not present'); $this->assertFileExists("$CFG->dirroot/mod/forum", 'forum module is not present'); $this->assertFileExists("$CFG->dirroot/$CFG->admin/tool/phpunit", 'phpunit tool is not present'); - $this->assertFileNotExists("$CFG->dirroot/mod/xxxxxxx"); - $this->assertFileNotExists("$CFG->dirroot/enrol/autorize"); + $this->assertFileDoesNotExist("$CFG->dirroot/mod/xxxxxxx"); + $this->assertFileDoesNotExist("$CFG->dirroot/enrol/autorize"); // Ready for upgrade. $assignversion = get_config('mod_assign', 'version'); diff --git a/lib/tests/setuplib_test.php b/lib/tests/setuplib_test.php index 7e9f2d21f53..e89ac56c348 100644 --- a/lib/tests/setuplib_test.php +++ b/lib/tests/setuplib_test.php @@ -112,7 +112,7 @@ class core_setuplib_testcase extends advanced_testcase { remove_dir($CFG->localcachedir, true); $dir = make_localcache_directory('', false); $this->assertSame($CFG->localcachedir, $dir); - $this->assertFileNotExists("$CFG->localcachedir/.htaccess"); + $this->assertFileDoesNotExist("$CFG->localcachedir/.htaccess"); $this->assertFileExists($timestampfile); $this->assertTimeCurrent(filemtime($timestampfile)); @@ -123,7 +123,7 @@ class core_setuplib_testcase extends advanced_testcase { $CFG->localcachedir = "$CFG->dataroot/testlocalcache"; $this->setCurrentTimeStart(); $timestampfile = "$CFG->localcachedir/.lastpurged"; - $this->assertFileNotExists($timestampfile); + $this->assertFileDoesNotExist($timestampfile); $dir = make_localcache_directory('', false); $this->assertSame($CFG->localcachedir, $dir); @@ -146,8 +146,8 @@ class core_setuplib_testcase extends advanced_testcase { $now = $this->setCurrentTimeStart(); set_config('localcachedirpurged', $now - 2); purge_all_caches(); - $this->assertFileNotExists($testfile); - $this->assertFileNotExists(dirname($testfile)); + $this->assertFileDoesNotExist($testfile); + $this->assertFileDoesNotExist(dirname($testfile)); $this->assertFileExists($timestampfile); $this->assertTimeCurrent(filemtime($timestampfile)); $this->assertTimeCurrent($CFG->localcachedirpurged); @@ -163,8 +163,8 @@ class core_setuplib_testcase extends advanced_testcase { $this->setCurrentTimeStart(); $dir = make_localcache_directory('', false); $this->assertSame("$CFG->localcachedir", $dir); - $this->assertFileNotExists($testfile); - $this->assertFileNotExists(dirname($testfile)); + $this->assertFileDoesNotExist($testfile); + $this->assertFileDoesNotExist(dirname($testfile)); $this->assertFileExists($timestampfile); $this->assertTimeCurrent(filemtime($timestampfile)); }