Merge branch '3.4' into 4.4

* 3.4:
  [CI] Silence errors when remove file/dir on test tearDown()
This commit is contained in:
Fabien Potencier 2020-10-14 11:30:35 +02:00
commit 9982713327
12 changed files with 16 additions and 18 deletions

View File

@ -142,7 +142,7 @@ class LintCommandTest extends TestCase
{ {
foreach ($this->files as $file) { foreach ($this->files as $file) {
if (file_exists($file)) { if (file_exists($file)) {
unlink($file); @unlink($file);
} }
} }
} }

View File

@ -168,9 +168,9 @@ EOF;
{ {
foreach ($this->files as $file) { foreach ($this->files as $file) {
if (file_exists($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');
} }
} }

View File

@ -30,7 +30,7 @@ class ConfigCacheTest extends TestCase
foreach ($files as $file) { foreach ($files as $file) {
if (file_exists($file)) { if (file_exists($file)) {
unlink($file); @unlink($file);
} }
} }
} }

View File

@ -30,7 +30,7 @@ class FileExistenceResourceTest extends TestCase
protected function tearDown(): void protected function tearDown(): void
{ {
if (file_exists($this->file)) { if (file_exists($this->file)) {
unlink($this->file); @unlink($this->file);
} }
} }

View File

@ -30,11 +30,9 @@ class FileResourceTest extends TestCase
protected function tearDown(): void protected function tearDown(): void
{ {
if (!file_exists($this->file)) { if (file_exists($this->file)) {
return; @unlink($this->file);
} }
unlink($this->file);
} }
public function testGetResource() public function testGetResource()

View File

@ -31,7 +31,7 @@ class ResourceCheckerConfigCacheTest extends TestCase
foreach ($files as $file) { foreach ($files as $file) {
if (file_exists($file)) { if (file_exists($file)) {
unlink($file); @unlink($file);
} }
} }
} }

View File

@ -168,9 +168,9 @@ class FileBagTest extends TestCase
protected function tearDown(): void protected function tearDown(): void
{ {
foreach (glob(sys_get_temp_dir().'/form_test/*') as $file) { 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');
} }
} }

View File

@ -43,7 +43,7 @@ class MockFileSessionStorageTest extends TestCase
{ {
array_map('unlink', glob($this->sessionDir.'/*')); array_map('unlink', glob($this->sessionDir.'/*'));
if (is_dir($this->sessionDir)) { if (is_dir($this->sessionDir)) {
rmdir($this->sessionDir); @rmdir($this->sessionDir);
} }
$this->sessionDir = null; $this->sessionDir = null;
$this->storage = null; $this->storage = null;

View File

@ -47,7 +47,7 @@ class NativeSessionStorageTest extends TestCase
session_write_close(); session_write_close();
array_map('unlink', glob($this->savePath.'/*')); array_map('unlink', glob($this->savePath.'/*'));
if (is_dir($this->savePath)) { if (is_dir($this->savePath)) {
rmdir($this->savePath); @rmdir($this->savePath);
} }
$this->savePath = null; $this->savePath = null;

View File

@ -43,7 +43,7 @@ class PhpBridgeSessionStorageTest extends TestCase
session_write_close(); session_write_close();
array_map('unlink', glob($this->savePath.'/*')); array_map('unlink', glob($this->savePath.'/*'));
if (is_dir($this->savePath)) { if (is_dir($this->savePath)) {
rmdir($this->savePath); @rmdir($this->savePath);
} }
$this->savePath = null; $this->savePath = null;

View File

@ -45,7 +45,7 @@ abstract class FileValidatorTest extends ConstraintValidatorTestCase
} }
if (file_exists($this->path)) { if (file_exists($this->path)) {
unlink($this->path); @unlink($this->path);
} }
$this->path = null; $this->path = null;

View File

@ -129,11 +129,11 @@ YAML;
{ {
foreach ($this->files as $file) { foreach ($this->files as $file) {
if (file_exists($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');
} }
} }