minor #38560 [CI] Silence errors when remove file/dir on test tearDown() (Nyholm)
This PR was merged into the 3.4 branch.
Discussion
----------
[CI] Silence errors when remove file/dir on test tearDown()
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? |
| Deprecations? |
| Tickets |
| License | MIT
| Doc PR |
Requested in #38556
Commits
-------
efef41faa1
[CI] Silence errors when remove file/dir on test tearDown()
This commit is contained in:
commit
9b2dcac5d3
@ -120,7 +120,7 @@ class LintCommandTest extends TestCase
|
||||
{
|
||||
foreach ($this->files as $file) {
|
||||
if (file_exists($file)) {
|
||||
unlink($file);
|
||||
@unlink($file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -174,9 +174,9 @@ EOF;
|
||||
{
|
||||
foreach ($this->files as $file) {
|
||||
if (file_exists($file)) {
|
||||
unlink($file);
|
||||
@unlink($file);
|
||||
}
|
||||
}
|
||||
rmdir(sys_get_temp_dir().'/yml-lint-test');
|
||||
@rmdir(sys_get_temp_dir().'/yml-lint-test');
|
||||
}
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ class ConfigCacheTest extends TestCase
|
||||
|
||||
foreach ($files as $file) {
|
||||
if (file_exists($file)) {
|
||||
unlink($file);
|
||||
@unlink($file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ class FileExistenceResourceTest extends TestCase
|
||||
protected function tearDown()
|
||||
{
|
||||
if (file_exists($this->file)) {
|
||||
unlink($this->file);
|
||||
@unlink($this->file);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,11 +30,9 @@ class FileResourceTest extends TestCase
|
||||
|
||||
protected function tearDown()
|
||||
{
|
||||
if (!file_exists($this->file)) {
|
||||
return;
|
||||
if (file_exists($this->file)) {
|
||||
@unlink($this->file);
|
||||
}
|
||||
|
||||
unlink($this->file);
|
||||
}
|
||||
|
||||
public function testGetResource()
|
||||
|
@ -31,7 +31,7 @@ class ResourceCheckerConfigCacheTest extends TestCase
|
||||
|
||||
foreach ($files as $file) {
|
||||
if (file_exists($file)) {
|
||||
unlink($file);
|
||||
@unlink($file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -103,11 +103,9 @@ class AutowireServiceResourceTest extends TestCase
|
||||
|
||||
protected function tearDown()
|
||||
{
|
||||
if (!file_exists($this->file)) {
|
||||
return;
|
||||
if (file_exists($this->file)) {
|
||||
@unlink($this->file);
|
||||
}
|
||||
|
||||
unlink($this->file);
|
||||
}
|
||||
|
||||
private function getStaleFileTime()
|
||||
|
@ -165,9 +165,9 @@ class FileBagTest extends TestCase
|
||||
protected function tearDown()
|
||||
{
|
||||
foreach (glob(sys_get_temp_dir().'/form_test/*') as $file) {
|
||||
unlink($file);
|
||||
@unlink($file);
|
||||
}
|
||||
|
||||
rmdir(sys_get_temp_dir().'/form_test');
|
||||
@rmdir(sys_get_temp_dir().'/form_test');
|
||||
}
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ class MockFileSessionStorageTest extends TestCase
|
||||
{
|
||||
array_map('unlink', glob($this->sessionDir.'/*'));
|
||||
if (is_dir($this->sessionDir)) {
|
||||
rmdir($this->sessionDir);
|
||||
@rmdir($this->sessionDir);
|
||||
}
|
||||
$this->sessionDir = null;
|
||||
$this->storage = null;
|
||||
|
@ -47,7 +47,7 @@ class NativeSessionStorageTest extends TestCase
|
||||
session_write_close();
|
||||
array_map('unlink', glob($this->savePath.'/*'));
|
||||
if (is_dir($this->savePath)) {
|
||||
rmdir($this->savePath);
|
||||
@rmdir($this->savePath);
|
||||
}
|
||||
|
||||
$this->savePath = null;
|
||||
|
@ -43,7 +43,7 @@ class PhpBridgeSessionStorageTest extends TestCase
|
||||
session_write_close();
|
||||
array_map('unlink', glob($this->savePath.'/*'));
|
||||
if (is_dir($this->savePath)) {
|
||||
rmdir($this->savePath);
|
||||
@rmdir($this->savePath);
|
||||
}
|
||||
|
||||
$this->savePath = null;
|
||||
|
@ -45,7 +45,7 @@ abstract class FileValidatorTest extends ConstraintValidatorTestCase
|
||||
}
|
||||
|
||||
if (file_exists($this->path)) {
|
||||
unlink($this->path);
|
||||
@unlink($this->path);
|
||||
}
|
||||
|
||||
$this->path = null;
|
||||
|
@ -123,11 +123,11 @@ YAML;
|
||||
{
|
||||
foreach ($this->files as $file) {
|
||||
if (file_exists($file)) {
|
||||
unlink($file);
|
||||
@unlink($file);
|
||||
}
|
||||
}
|
||||
|
||||
rmdir(sys_get_temp_dir().'/framework-yml-lint-test');
|
||||
@rmdir(sys_get_temp_dir().'/framework-yml-lint-test');
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user