Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Napoli <matthieu@mnapoli.fr>2015-01-13 04:37:33 +0300
committerMatthieu Napoli <matthieu@mnapoli.fr>2015-01-13 04:37:33 +0300
commit24ebd02f0424f464362227ec1cc6cdcca600dcfd (patch)
tree89dd916759a5691d655d061a53121f4761cab710 /tests/PHPUnit/Integration/FilesystemTest.php
parente2b9956e4bd92ca9e234d10d527be9e8caf2b68f (diff)
Fix #6927 race conditions when deleting files
Diffstat (limited to 'tests/PHPUnit/Integration/FilesystemTest.php')
-rw-r--r--tests/PHPUnit/Integration/FilesystemTest.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/PHPUnit/Integration/FilesystemTest.php b/tests/PHPUnit/Integration/FilesystemTest.php
index f3879927e5..0a17edacb8 100644
--- a/tests/PHPUnit/Integration/FilesystemTest.php
+++ b/tests/PHPUnit/Integration/FilesystemTest.php
@@ -8,6 +8,7 @@
namespace Piwik\Tests\Integration;
+use Piwik\Container\StaticContainer;
use Piwik\Filesystem;
/**
@@ -30,4 +31,18 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase
$this->assertNull($size);
}
+ public function test_removeFile_shouldRemoveFile()
+ {
+ $tmpFile = StaticContainer::get('path.tmp') . '/filesystem-test-file';
+ touch($tmpFile);
+
+ Filesystem::remove($tmpFile);
+
+ $this->assertFileNotExists($tmpFile);
+ }
+
+ public function test_removeNonExistingFile_shouldNotThrowException()
+ {
+ Filesystem::remove('foo');
+ }
} \ No newline at end of file