[TASK] Skip two tests in LocalDriverTests in PHP 5.3 45/26845/2
authorSteffen Ritter <info@rs-websystems.de>
Wed, 15 Jan 2014 14:32:49 +0000 (15:32 +0100)
committerSteffen Ritter <info@rs-websystems.de>
Wed, 15 Jan 2014 14:57:14 +0000 (15:57 +0100)
For most tests in the LocalDriverTest vfsStream is used to
emulate the filesystem. This needs PHP filesystem functions
to use the stream wrappers.

For touch() this has been enabled with PHP 5.4. The reversal
conclusion is, that this does not work with PHP 5.3 which
causes failing tests there.

As a result If the PHP version is 5.3 we skip the two tests.
This is a follow-up to https://review.typo3.org/#/c/26520/

Resolves: #54230
Releases: 6.2
Change-Id: I4e92927e1d77f825bab8583318a944a8916051d5
Reviewed-on: https://review.typo3.org/26845
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
typo3/sysext/core/Tests/Unit/Resource/Driver/LocalDriverTest.php

index c8bec51..b2047a7 100644 (file)
@@ -381,8 +381,12 @@ class LocalDriverTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCase {
 
        /**
         * @test
+        * @see http://phpmagazin.de/vfsStream-1.1.0-nutzt-PHP-5.4-M%C3%B6glichkeiten-064406.html
         */
        public function newFilesCanBeCreated() {
+               if (version_compare(PHP_VERSION, '5.4.0', '<')) {
+                       $this->markTestSkipped('touch() does not work with vfsStream in PHP 5.3 and below.');
+               }
                $fixture = $this->createDriverFixture();
                $fixture->createFile('testfile.txt', '/');
                $this->assertTrue($fixture->fileExists('/testfile.txt'));
@@ -390,9 +394,12 @@ class LocalDriverTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCase {
 
        /**
         * @test
-        *
+        * @see http://phpmagazin.de/vfsStream-1.1.0-nutzt-PHP-5.4-M%C3%B6glichkeiten-064406.html
         */
        public function createdFilesAreEmpty() {
+               if (version_compare(PHP_VERSION, '5.4.0', '<')) {
+                       $this->markTestSkipped('touch() does not work with vfsStream in PHP 5.3 and below.');
+               }
                $fixture = $this->createDriverFixture();
                $fixture->createFile('testfile.txt', '/');
                $this->assertTrue($fixture->fileExists('/testfile.txt'));