[TASK] Remove skipped FAL tests 40/30940/2
authorSusanne Moog <typo3@susannemoog.de>
Fri, 20 Jun 2014 14:37:57 +0000 (16:37 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Fri, 20 Jun 2014 14:55:51 +0000 (16:55 +0200)
FAL includes some tests that are skipped ever since
FAL was merged. Most of them don't even have a
comment as to why and need to be completely rewritten
as the functionality changed.

We should remove these tests for now.

Change-Id: Ib75b4ea104a968019e06937974eaa1846cfe3a8a
Releases: 6.3
Resolves: #59728
Reviewed-on: https://review.typo3.org/30940
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/core/Tests/Unit/Resource/FileTest.php

index 2d06152..bdafd9e 100644 (file)
@@ -28,8 +28,7 @@ use TYPO3\CMS\Core\Resource\ResourceStorage;
 /**
  * Testcase for the file class of the TYPO3 FAL
  *
- * @author Andreas Wolf <andreas.wolf@ikt-werk.de>
- * @todo Many, many, many tests are skipped in this test case...
+ * @author Andreas Wolf <andreas.wolf@ikt-werk.de>.
  */
 class FileTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
@@ -68,30 +67,6 @@ class FileTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @test
-        * @todo Old code getAvailableProperties() needs to be replaced by current behaviour
-        */
-       public function propertiesPassedToConstructorAreAvailableViaGenericGetter() {
-               $this->markTestSkipped('TYPO3\\CMS\\Core\\Resource\\File::getAvailableProperties() does not exist');
-               $properties = array(
-                       uniqid() => uniqid(),
-                       uniqid() => uniqid(),
-                       'uid' => 1
-               );
-               $fixture = new \TYPO3\CMS\Core\Resource\File($properties, $this->storageMock);
-               $availablePropertiesBackup = \TYPO3\CMS\Core\Resource\File::getAvailableProperties();
-               \TYPO3\CMS\Core\Resource\File::setAvailableProperties(array_keys($properties));
-               foreach ($properties as $key => $value) {
-                       $this->assertTrue($fixture->hasProperty($key));
-                       $this->assertEquals($value, $fixture->getProperty($key));
-               }
-               $this->assertFalse($fixture->hasProperty(uniqid()));
-               \TYPO3\CMS\Core\Resource\File::setAvailableProperties($availablePropertiesBackup);
-               $this->setExpectedException('InvalidArgumentException', '', 1314226805);
-               $fixture->getProperty(uniqid());
-       }
-
-       /**
-        * @test
         */
        public function commonPropertiesAreAvailableWithOwnGetters() {
                $properties = array(
@@ -223,117 +198,6 @@ class FileTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $fixture->moveTo($targetFolder);
        }
 
-       /**
-        * @test
-        */
-       public function openCorrectlyOpensFileInDriver() {
-               $this->markTestSkipped();
-               $fixture = $this->prepareFixture();
-               $fileMode = 'invalidMode';
-               $mockDriver = $this->getMockForAbstractClass('t3lib_file_driver_Abstract');
-               $mockDriver->expects($this->atLeastOnce())->method('getFileHandle')->with($this->equalTo($fixture), $this->equalTo($fileMode));
-               $fixture->setStorageDriver($mockDriver);
-               $fixture->open($fileMode);
-       }
-
-       /**
-        * @test
-        */
-       public function isOpenReturnsCorrectValuesForClosedAndOpenFile() {
-               $this->markTestSkipped();
-               $fixture = $this->prepareFixture();
-               $fileMode = 'r';
-               $mockFileHandle = $this->getMock('TYPO3\\CMS\\Core\\Resource\\FileHandle', array(), array(), '', FALSE);
-               $mockFileHandle->expects($this->any())->method('isOpen')->will($this->returnValue(TRUE));
-               $mockDriver = $this->getMockForAbstractClass('t3lib_file_driver_Abstract');
-               $mockDriver->expects($this->any())->method('getFileHandle')->will($this->returnValue($mockFileHandle));
-               $fixture->setStorageDriver($mockDriver);
-               $this->assertFalse($fixture->isOpen());
-               $fixture->open($fileMode);
-               $this->assertTrue($fixture->isOpen());
-       }
-
-       /**
-        * @test
-        */
-       public function fileIsCorrectlyClosed() {
-               $this->markTestSkipped();
-               $fixture = $this->prepareFixture();
-               $fileMode = 'r';
-               $mockFileHandle = $this->getMock('TYPO3\\CMS\\Core\\Resource\\FileHandle', array(), array(), '', FALSE);
-               $mockFileHandle->expects($this->once())->method('close');
-               $mockDriver = $this->getMockForAbstractClass('t3lib_file_driver_Abstract');
-               $mockDriver->expects($this->any())->method('getFileHandle')->will($this->returnValue($mockFileHandle));
-               $fixture->setStorageDriver($mockDriver);
-               $fixture->open($fileMode);
-               $fixture->close();
-               $this->assertFalse($fixture->isOpen());
-       }
-
-       /**
-        * @test
-        */
-       public function readReturnsRequestedContentsFromDriver() {
-               $this->markTestSkipped();
-               $fixture = $this->prepareFixture();
-               $fileMode = 'r';
-               $fileContents = 'Some random file contents.';
-               $bytesToRead = 10;
-               $mockFileHandle = $this->getMock('TYPO3\\CMS\\Core\\Resource\\FileHandle', array(), array(), '', FALSE);
-               $mockFileHandle->expects($this->any())->method('isOpen')->will($this->returnValue(TRUE));
-               $mockDriver = $this->getMockForAbstractClass('t3lib_file_driver_Abstract');
-               $mockDriver->expects($this->any())->method('getFileHandle')->will($this->returnValue($mockFileHandle));
-               $mockDriver->expects($this->once())->method('readFromFile')->with($this->anything(), $this->equalTo($bytesToRead))->will($this->returnValue(substr($fileContents, 0, $bytesToRead)));
-               $fixture->setStorageDriver($mockDriver);
-               $fixture->open($fileMode);
-               $this->assertEquals(substr($fileContents, 0, $bytesToRead), $fixture->read($bytesToRead));
-       }
-
-       /**
-        * @test
-        */
-       public function readFailsIfFileIsClosed() {
-               $this->markTestSkipped();
-               $this->setExpectedException('\\RuntimeException', '', 1299863431);
-               $fixture = $this->prepareFixture();
-               $mockFileHandle = $this->getMock('TYPO3\\CMS\\Core\\Resource\\FileHandle', array(), array(), '', FALSE);
-               $mockDriver = $this->getMockForAbstractClass('t3lib_file_driver_Abstract');
-               $mockDriver->expects($this->any())->method('getFileHandle')->will($this->returnValue($mockFileHandle));
-               $fixture->setStorageDriver($mockDriver);
-               $fixture->read(1);
-       }
-
-       /**
-        * @test
-        */
-       public function writePassesContentsToDriver() {
-               $this->markTestSkipped();
-               $fixture = $this->prepareFixture();
-               $fileMode = 'r+';
-               $fileContents = 'Some random file contents.';
-               $mockFileHandle = $this->getMock('TYPO3\\CMS\\Core\\Resource\\FileHandle', array(), array(), '', FALSE);
-               $mockFileHandle->expects($this->any())->method('isOpen')->will($this->returnValue(TRUE));
-               $mockDriver = $this->getMockForAbstractClass('t3lib_file_driver_Abstract');
-               $mockDriver->expects($this->any())->method('getFileHandle')->will($this->returnValue($mockFileHandle));
-               $mockDriver->expects($this->once())->method('writeToFile')->with($this->anything(), $this->equalTo($fileContents))->will($this->returnValue(TRUE));
-               $fixture->setStorageDriver($mockDriver);
-               $fixture->open($fileMode);
-               $this->assertTrue($fixture->write($fileContents));
-       }
-
-       /**
-        * @test
-        */
-       public function writeFailsIfFileIsClosed() {
-               $this->markTestSkipped();
-               $this->setExpectedException('\\RuntimeException', '', 1299863432);
-               $fixture = $this->prepareFixture();
-               $mockFileHandle = $this->getMock('TYPO3\\CMS\\Core\\Resource\\FileHandle', array(), array(), '', FALSE);
-               $mockDriver = $this->getMockForAbstractClass('t3lib_file_driver_Abstract');
-               $mockDriver->expects($this->any())->method('getFileHandle')->will($this->returnValue($mockFileHandle));
-               $fixture->setStorageDriver($mockDriver);
-               $fixture->write('asdf');
-       }
 
        public function filenameExtensionDataProvider() {
                return array(