Skip to content

Commit efef41f

Browse files
committed
[CI] Silence errors when remove file/dir on test tearDown()
1 parent 84887f2 commit efef41f

File tree

13 files changed

+18
-22
lines changed

13 files changed

+18
-22
lines changed

src/Symfony/Bridge/Twig/Tests/Command/LintCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ protected function tearDown()
120120
{
121121
foreach ($this->files as $file) {
122122
if (file_exists($file)) {
123-
unlink($file);
123+
@unlink($file);
124124
}
125125
}
126126
}

src/Symfony/Bundle/FrameworkBundle/Tests/Command/YamlLintCommandTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ protected function tearDown()
174174
{
175175
foreach ($this->files as $file) {
176176
if (file_exists($file)) {
177-
unlink($file);
177+
@unlink($file);
178178
}
179179
}
180-
rmdir(sys_get_temp_dir().'/yml-lint-test');
180+
@rmdir(sys_get_temp_dir().'/yml-lint-test');
181181
}
182182
}

src/Symfony/Component/Config/Tests/ConfigCacheTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ protected function tearDown()
3030

3131
foreach ($files as $file) {
3232
if (file_exists($file)) {
33-
unlink($file);
33+
@unlink($file);
3434
}
3535
}
3636
}

src/Symfony/Component/Config/Tests/Resource/FileExistenceResourceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ protected function setUp()
3030
protected function tearDown()
3131
{
3232
if (file_exists($this->file)) {
33-
unlink($this->file);
33+
@unlink($this->file);
3434
}
3535
}
3636

src/Symfony/Component/Config/Tests/Resource/FileResourceTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,9 @@ protected function setUp()
3030

3131
protected function tearDown()
3232
{
33-
if (!file_exists($this->file)) {
34-
return;
33+
if (file_exists($this->file)) {
34+
@unlink($this->file);
3535
}
36-
37-
unlink($this->file);
3836
}
3937

4038
public function testGetResource()

src/Symfony/Component/Config/Tests/ResourceCheckerConfigCacheTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ protected function tearDown()
3131

3232
foreach ($files as $file) {
3333
if (file_exists($file)) {
34-
unlink($file);
34+
@unlink($file);
3535
}
3636
}
3737
}

src/Symfony/Component/DependencyInjection/Tests/Config/AutowireServiceResourceTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,9 @@ public function testNotFreshIfClassNotFound()
103103

104104
protected function tearDown()
105105
{
106-
if (!file_exists($this->file)) {
107-
return;
106+
if (file_exists($this->file)) {
107+
@unlink($this->file);
108108
}
109-
110-
unlink($this->file);
111109
}
112110

113111
private function getStaleFileTime()

src/Symfony/Component/HttpFoundation/Tests/FileBagTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ protected function setUp()
165165
protected function tearDown()
166166
{
167167
foreach (glob(sys_get_temp_dir().'/form_test/*') as $file) {
168-
unlink($file);
168+
@unlink($file);
169169
}
170170

171-
rmdir(sys_get_temp_dir().'/form_test');
171+
@rmdir(sys_get_temp_dir().'/form_test');
172172
}
173173
}

src/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockFileSessionStorageTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ protected function tearDown()
4343
{
4444
array_map('unlink', glob($this->sessionDir.'/*'));
4545
if (is_dir($this->sessionDir)) {
46-
rmdir($this->sessionDir);
46+
@rmdir($this->sessionDir);
4747
}
4848
$this->sessionDir = null;
4949
$this->storage = null;

src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ protected function tearDown()
4747
session_write_close();
4848
array_map('unlink', glob($this->savePath.'/*'));
4949
if (is_dir($this->savePath)) {
50-
rmdir($this->savePath);
50+
@rmdir($this->savePath);
5151
}
5252

5353
$this->savePath = null;

0 commit comments

Comments
 (0)