* upd: phpunit 9 compatibility

This commit is contained in:
Karsten Deubert authored and Christian Münch committed 2021-11-29 10:55:15 +01:00
1 parent cd4ea2c443
commit b89300b586
3 files changed
+29 -27

No files matched your search

+9 -9
View File
@@ -1,11 +1,11 @@
<?xml version="1.0"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/6.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
backupGlobals="true"
bootstrap="tests/bootstrap.php"
backupStaticAttributes="false"
beStrictAboutTestsThatDoNotTestAnything="false"
cacheTokens="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
@@ -24,12 +24,12 @@
<directory>./tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<coverage includeUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
<exclude>
<file>src/bootstrap.php</file>
</exclude>
</whitelist>
</filter>
</include>
<exclude>
<file>src/bootstrap.php</file>
</exclude>
</coverage>
</phpunit>
+12 -10
View File
@@ -195,16 +195,18 @@ CONFIG;
$config = $application->getConfig();
// Check for loaded project data
$this->assertArraySubset(
[
'foo' => [
'bar' => [
'magerun' => 'rockz!'
]
$expected = [
'foo' => [
'bar' => [
'magerun' => 'rockz!'
]
],
$config
);
]
];
// replaced deprecated assertArraySubset with a less elegant (but simpler) approach
foreach ($expected as $expectedKey => $expectedValue) {
$this->assertArrayHasKey($expectedKey, $config);
$this->assertEquals($expectedValue, $config[$expectedKey]);
}
}
}
+8 -8
View File
@@ -60,8 +60,8 @@ class FilesystemTest extends TestCase
rmdir($dest . "/folder2");
rmdir($dest);
$this->assertFileNotExists($dest . "/folder1/file1.txt");
$this->assertFileNotExists($dest);
$this->assertFileDoesNotExist($dest . "/folder1/file1.txt");
$this->assertFileDoesNotExist($dest);
is_dir($tmp . '/a') || mkdir($tmp . '/a');
touch($tmp . '/file1.txt');
@@ -89,7 +89,7 @@ class FilesystemTest extends TestCase
$this->fileSystem->recursiveCopy($basePath, $dest, ['ignore.me']);
$this->assertFileExists($dest . "/folder1/file1.txt");
$this->assertFileExists($dest . "/folder2/file2.txt");
$this->assertFileNotExists($dest . "/folder1/ignore.me");
$this->assertFileDoesNotExist($dest . "/folder1/ignore.me");
//cleanup
unlink($file1);
@@ -126,7 +126,7 @@ class FilesystemTest extends TestCase
$this->fileSystem->recursiveRemoveDirectory($basePath);
$this->assertFileExists($symLinkedFile);
$this->assertFileNotExists($basePath);
$this->assertFileDoesNotExist($basePath);
}
public function testRecursiveRemove()
@@ -144,7 +144,7 @@ class FilesystemTest extends TestCase
touch($file2);
$this->fileSystem->recursiveRemoveDirectory($basePath);
$this->assertFileNotExists($basePath);
$this->assertFileDoesNotExist($basePath);
}
public function testRecursiveRemoveWithTrailingSlash()
@@ -162,7 +162,7 @@ class FilesystemTest extends TestCase
touch($file2);
$this->fileSystem->recursiveRemoveDirectory($basePath . "/");
$this->assertFileNotExists($basePath);
$this->assertFileDoesNotExist($basePath);
}
public function testFalseIsReturnedIfDirectoryNotExist()
@@ -194,8 +194,8 @@ class FilesystemTest extends TestCase
$this->fileSystem->recursiveRemoveDirectory($basePath, true);
$this->assertFileExists($basePath);
$this->assertFileNotExists($folder1);
$this->assertFileNotExists($folder2);
$this->assertFileDoesNotExist($folder1);
$this->assertFileDoesNotExist($folder2);
}
/**