[TASK] Tests: Skip some FAL tests 24/28424/4
authorChristian Kuhn <lolli@schwarzbu.ch>
Sat, 15 Mar 2014 17:06:54 +0000 (18:06 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Sat, 15 Mar 2014 18:48:02 +0000 (19:48 +0100)
While the FAL tests were already streamlined and simplified a lot,
the ResourceStorageTest class is still a mixture of functional and
unit test that involves heavy set up code and still does not mock
dependencies properly.
This test class needs a rewrite and a clean separation of units
together with a number of working functional tests to be of any use.
For now, all tests that rely on initialized database are skipped and
marked as TODO.

Change-Id: I3191c809c50f4f19ab91b9a5b5f2f3ebc3fa47ff
Resolves: #56940
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28424
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/core/Tests/Unit/Resource/ResourceStorageTest.php

index 7ca1ccc..26a50ea 100644 (file)
@@ -80,8 +80,7 @@ class ResourceStorageTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCa
                }
                $mockedMethods[] = 'getIndexer';
 
-
-               $this->fixture = $this->getMock('TYPO3\\CMS\\Core\\Resource\\ResourceStorage', $mockedMethods, array($driverObject, $storageRecord));
+               $this->fixture = $this->getMock('TYPO3\\CMS\\Core\\Resource\\ResourceStorage', $mockedMethods, array($driverObject, $storageRecord), '', FALSE);
                $this->fixture->expects($this->any())->method('getIndexer')->will($this->returnValue($this->getMock('TYPO3\CMS\Core\Resource\Index\Indexer', array(), array(), '', FALSE)));
                foreach ($permissionMethods as $method) {
                        $this->fixture->expects($this->any())->method($method)->will($this->returnValue(TRUE));
@@ -183,8 +182,10 @@ class ResourceStorageTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCa
        /**
         * @test
         * @dataProvider capabilitiesDataProvider
+        * @TODO: Rewrite or move to functional suite
         */
        public function capabilitiesOfStorageObjectAreCorrectlySet(array $capabilities) {
+               $this->markTestSkipped('This test does way to much and is mocked incomplete. Skipped for now.');
                $storageRecord = array(
                        'is_public' => $capabilities['public'],
                        'is_writable' => $capabilities['writable'],
@@ -207,8 +208,10 @@ class ResourceStorageTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCa
 
        /**
         * @test
+        * @TODO: Rewrite or move to functional suite
         */
        public function fileAndFolderListFiltersAreInitializedWithDefaultFilters() {
+               $this->markTestSkipped('This test does way to much and is mocked incomplete. Skipped for now.');
                $this->prepareFixture(array());
                $this->assertEquals($GLOBALS['TYPO3_CONF_VARS']['SYS']['fal']['defaultFilterCallbacks'], $this->fixture->getFileAndFolderNameFilters());
        }
@@ -356,8 +359,10 @@ class ResourceStorageTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCa
        /**
         * @test
         * @group integration
+        * @TODO: Rewrite or move to functional suite
         */
        public function setFileContentsUpdatesObjectProperties() {
+               $this->markTestSkipped('This test does way to much and is mocked incomplete. Skipped for now.');
                $this->initializeVfs();
                $driverObject = $this->getMockForAbstractClass('TYPO3\\CMS\\Core\\Resource\\Driver\\AbstractDriver', array(), '', FALSE);
                $this->fixture = $this->getMock('TYPO3\\CMS\\Core\\Resource\\ResourceStorage', array('getFileIndexRepository', 'checkFileActionPermission'), array($driverObject, array()));
@@ -402,8 +407,10 @@ class ResourceStorageTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCa
        /**
         * @test
         * @group integration
+        * @TODO: Rewrite or move to functional suite
         */
        public function moveFileCallsDriversMethodsWithCorrectArguments() {
+               $this->markTestSkipped('This test does way to much and is mocked incomplete. Skipped for now.');
                $localFilePath = '/path/to/localFile';
                $sourceFileIdentifier = '/sourceFile.ext';
                $fileInfoDummy = array(
@@ -441,8 +448,10 @@ class ResourceStorageTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCa
        /**
         * @test
         * @group integration
+        * @TODO: Rewrite or move to functional suite
         */
        public function storageUsesInjectedFilemountsToCheckForMountBoundaries() {
+               $this->markTestSkipped('This test does way to much and is mocked incomplete. Skipped for now.');
                $mockedFile = $this->getSimpleFileMock('/mountFolder/file');
                $this->addToMount(array(
                        'mountFolder' => array(
@@ -460,8 +469,10 @@ class ResourceStorageTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCa
 
        /**
         * @test
+        * @TODO: Rewrite or move to functional suite
         */
        public function createFolderChecksIfParentFolderExistsBeforeCreatingFolder() {
+               $this->markTestSkipped('This test does way to much and is mocked incomplete. Skipped for now.');
                $mockedParentFolder = $this->getSimpleFolderMock('/someFolder/');
                $mockedDriver = $this->createDriverMock(array());
                $mockedDriver->expects($this->once())->method('folderExists')->with($this->equalTo('/someFolder/'))->will($this->returnValue(TRUE));
@@ -490,8 +501,10 @@ class ResourceStorageTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCa
 
        /**
         * @test
+        * @TODO: Rewrite or move to functional suite
         */
        public function createFolderCallsDriverForFolderCreation() {
+               $this->markTestSkipped('This test does way to much and is mocked incomplete. Skipped for now.');
                $mockedParentFolder = $this->getSimpleFolderMock('/someFolder/');
                $this->prepareFixture(array(), TRUE);
                $mockedDriver = $this->createDriverMock(array(), $this->fixture);
@@ -502,8 +515,10 @@ class ResourceStorageTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCa
 
        /**
         * @test
+        * @TODO: Rewrite or move to functional suite
         */
        public function createFolderCanRecursivelyCreateFolders() {
+               $this->markTestSkipped('This test does way to much and is mocked incomplete. Skipped for now.');
                $this->addToMount(array('someFolder' => array()));
                $mockedDriver = $this->createDriverMock(array('basePath' => $this->getMountRootUrl()), NULL, NULL);
                $this->prepareFixture(array(), TRUE, $mockedDriver);
@@ -516,8 +531,10 @@ class ResourceStorageTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCa
 
        /**
         * @test
+        * @TODO: Rewrite or move to functional suite
         */
        public function createFolderUsesRootFolderAsParentFolderIfNotGiven() {
+               $this->markTestSkipped('This test does way to much and is mocked incomplete. Skipped for now.');
                $this->prepareFixture(array(), TRUE);
                $mockedDriver = $this->createDriverMock(array(), $this->fixture);
                $mockedDriver->expects($this->once())->method('getRootLevelFolder')->with()->will($this->returnValue('/'));
@@ -527,8 +544,10 @@ class ResourceStorageTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCa
 
        /**
         * @test
+        * @TODO: Rewrite or move to functional suite
         */
        public function createFolderCreatesNestedStructureEvenIfPartsAlreadyExist() {
+               $this->markTestSkipped('This test does way to much and is mocked incomplete. Skipped for now.');
                $this->addToMount(array(
                        'existingFolder' => array()
                ));
@@ -565,8 +584,10 @@ class ResourceStorageTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCa
 
        /**
         * @test
+        * @TODO: Rewrite or move to functional suite
         */
        public function getRoleReturnsDefaultForRegularFolders() {
+               $this->markTestSkipped('This test does way to much and is mocked incomplete. Skipped for now.');
                $folderIdentifier = uniqid();
                $this->addToMount(array(
                        $folderIdentifier => array()
@@ -577,5 +598,4 @@ class ResourceStorageTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCa
 
                $this->assertSame(\TYPO3\CMS\Core\Resource\FolderInterface::ROLE_DEFAULT, $role);
        }
-
-}
+}
\ No newline at end of file