8000 [CI] Silence errors when remove file/dir on test tearDown() by Nyholm · Pull Request #38560 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[CI] Silence errors when remove file/dir on test tearDown() #38560

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/Twig/Tests/Command/LintCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ protected function tearDown()
{
foreach ($this->files as $file) {
if (file_exists($file)) {
unlink($file);
@unlink($file);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@ protected function tearDown()
{
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');
}
}
2 changes: 1 addition & 1 deletion src/Symfony/Component/Config/Tests/ConfigCacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected fu 10000 nction tearDown()

foreach ($files as $file) {
if (file_exists($file)) {
unlink($file);
@unlink($file);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected function setUp()
protected function tearDown()
{
if (file_exists($this->file)) {
unlink($this->file);
@unlink($this->file);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@ protected function setUp()

protected function tearDown()
{
if (!file_exists($this->file)) {
return;
if (file_exists($this->file)) {
@unlink($this->file);
}

unlink($this->file);
}

public function testGetResource()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected function tearDown()

foreach ($files as $file) {
if (file_exists($file)) {
unlink($file);
@unlink($file);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,9 @@ public function testNotFreshIfClassNotFound()

protected function tearDown()
{
if (!file_exists($this->file)) {
return;
if (file_exists($this->file)) {
@unlink($this->file);
}

unlink($this->file);
}

private function getStaleFileTime()
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/HttpFoundation/Tests/FileBagTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ protected function setUp()
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');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected function tearDown()
{
array_map('unlink', glob($this->sessionDir.'/*'));
if (is_dir($this->sessionDir)) {
rmdir($this->sessionDir);
@rmdir($this->sessionDir);
}
$this->sessionDir = null;
$this->storage = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected function tearDown()
session_write_close();
array_map('unlink', glob($this->savePath.'/*'));
if (is_dir($this->savePath)) {
rmdir($this->savePath);
@rmdir($this->savePath);
}

$this->savePath = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected function tearDown()
session_write_close();
array_map('unlink', glob($this->savePath.'/*'));
if (is_dir($this->savePath)) {
rmdir($this->savePath);
@rmdir($this->savePath);
}

$this->savePath = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected function tearDown()
}

if (file_exists($this->path)) {
unlink($this->path);
@unlink($this->path);
}

$this->path = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@ protected function tearDown()
{
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');
}
}

Expand Down
0