[TASK] Move fixture files from tests/
authorChristian Kuhn <lolli@schwarzbu.ch>
Tue, 11 Sep 2012 18:25:53 +0000 (20:25 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 11 Sep 2012 18:34:45 +0000 (20:34 +0200)
There are still some fixture files within the root tests/ directory.
The patch moves them to Fixtures/ folders below the using tests
within the affected core and backend extensions.

Change-Id: Ied23b542a65becac02c9af576728da886552484d
Resolves: #40834
Related: #40095
Releases: 6.0
Reviewed-on: http://review.typo3.org/14525
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
tests/Unit/t3lib/fixtures/clear.gif [deleted file]
tests/Unit/t3lib/fixtures/clear.png [deleted file]
tests/Unit/t3lib/fixtures/ext_emconf.php [deleted file]
typo3/sysext/backend/Tests/Unit/Utility/Fixtures/clear.gif [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Utility/IconUtilityTest.php
typo3/sysext/core/Tests/Unit/Extension/ExtensionManagerTest.php
typo3/sysext/core/Tests/Unit/Extension/Fixtures/ext_emconf.php [new file with mode: 0644]
typo3/sysext/core/Tests/Unit/Utility/Fixtures/clear.gif [new file with mode: 0644]
typo3/sysext/core/Tests/Unit/Utility/Fixtures/clear.png [new file with mode: 0644]
typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php

diff --git a/tests/Unit/t3lib/fixtures/clear.gif b/tests/Unit/t3lib/fixtures/clear.gif
deleted file mode 100644 (file)
index 9ed1269..0000000
Binary files a/tests/Unit/t3lib/fixtures/clear.gif and /dev/null differ
diff --git a/tests/Unit/t3lib/fixtures/clear.png b/tests/Unit/t3lib/fixtures/clear.png
deleted file mode 100644 (file)
index b421b25..0000000
Binary files a/tests/Unit/t3lib/fixtures/clear.png and /dev/null differ
diff --git a/tests/Unit/t3lib/fixtures/ext_emconf.php b/tests/Unit/t3lib/fixtures/ext_emconf.php
deleted file mode 100644 (file)
index d9cdad5..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-$EM_CONF[$_EXTKEY] = array(
-       'title' => '',
-       'description' => 'This is a fixture extension configuration file used for unit tests.',
-       'category' => '',
-       'shy' => 1,
-       'dependencies' => '',
-       'conflicts' => '',
-       'priority' => '',
-       'loadOrder' => '',
-       'module' => '',
-       'state' => 'stable',
-       'internal' => 1,
-       'uploadfolder' => 0,
-       'createDirs' => '',
-       'modify_tables' => '',
-       'clearCacheOnLoad' => 0,
-       'lockType' => '',
-       'author' => '',
-       'author_email' => '',
-       'author_company' => '',
-       'CGLcompliance' => '',
-       'CGLcompliance_note' => '',
-       'version' => '1.2.3',
-       '_md5_values_when_last_written' => '',
-       'constraints' => array(
-               'depends' => array(),
-               'conflicts' => array(),
-               'suggests' => array()
-       ),
-       'suggests' => array()
-);
-?>
\ No newline at end of file
diff --git a/typo3/sysext/backend/Tests/Unit/Utility/Fixtures/clear.gif b/typo3/sysext/backend/Tests/Unit/Utility/Fixtures/clear.gif
new file mode 100644 (file)
index 0000000..9ed1269
Binary files /dev/null and b/typo3/sysext/backend/Tests/Unit/Utility/Fixtures/clear.gif differ
index 4958a1d..73417c7 100644 (file)
@@ -98,8 +98,7 @@ class IconUtilityTest extends \tx_phpunit_testcase {
                if (TYPO3_OS == 'WIN') {
                        $this->markTestSkipped('imagemakeFixesPermissionsOnNewFiles() test not available on Windows.');
                }
-               $testFinder = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_Phpunit_Service_TestFinder');
-               $fixtureGifFile = $testFinder->getAbsoluteCoreTestsPath() . 'Unit/t3lib/fixtures/clear.gif';
+               $fixtureGifFile = __DIR__ . '/Fixtures/clear.gif';
                // Create image ressource, determine target filename, fake target permission, run method and clean up
                $fixtureGifRessource = imagecreatefromgif($fixtureGifFile);
                $targetFilename = ((PATH_site . 'typo3temp/') . uniqid('test_')) . '.gif';
index 26206d1..dfcbc98 100644 (file)
@@ -212,15 +212,6 @@ class ExtensionManagerTest extends \tx_phpunit_testcase {
                return $tca;
        }
 
-       /**
-        * Returns the fixtures path for this testcase relative to PATH_site.
-        *
-        * @return string the fixtures path for this testcase, will not be empty
-        */
-       private function determineFixturesPath() {
-               return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_Phpunit_Service_TestFinder')->getRelativeCoreTestsPath() . 'Unit/t3lib/fixtures/';
-       }
-
        /////////////////////////////////////////////
        // Tests concerning getExtensionKeyByPrefix
        /////////////////////////////////////////////
@@ -922,13 +913,20 @@ throw new RuntimeException(\'\', 1340559079);
        public function getExtensionVersionForLoadedExtensionReturnsExtensionVersion() {
                $namespace = 'TYPO3\\CMS\\Core\\Extension';
                $className = uniqid('ExtensionManager');
-               eval(((((('namespace ' . $namespace .'; class ' . $className) . ' extends \\TYPO3\\CMS\\Core\\Extension\\ExtensionManager {') . '  public static function isLoaded() {') . '    return TRUE;') . '  }') . '}');
+               eval(
+                       'namespace ' . $namespace .';' .
+                       'class ' . $className . ' extends \\TYPO3\\CMS\\Core\\Extension\\ExtensionManager {' .
+                       '  public static function isLoaded() {' .
+                       '    return TRUE;' .
+                       '  }' .
+                       '}'
+               );
                $className = $namespace . '\\' . $className;
                \TYPO3\CMS\Core\Extension\ExtensionManager::clearExtensionKeyMap();
                $uniqueSuffix = uniqid('test');
                $extensionKey = 'unloadedextension' . $uniqueSuffix;
                $GLOBALS['TYPO3_LOADED_EXT'][$extensionKey] = array(
-                       'siteRelPath' => $this->determineFixturesPath()
+                       'siteRelPath' => 'typo3/sysext/core/Tests/Unit/Extension/Fixtures/',
                );
                $this->assertEquals('1.2.3', $className::getExtensionVersion($extensionKey));
        }
diff --git a/typo3/sysext/core/Tests/Unit/Extension/Fixtures/ext_emconf.php b/typo3/sysext/core/Tests/Unit/Extension/Fixtures/ext_emconf.php
new file mode 100644 (file)
index 0000000..d9cdad5
--- /dev/null
@@ -0,0 +1,33 @@
+<?php
+$EM_CONF[$_EXTKEY] = array(
+       'title' => '',
+       'description' => 'This is a fixture extension configuration file used for unit tests.',
+       'category' => '',
+       'shy' => 1,
+       'dependencies' => '',
+       'conflicts' => '',
+       'priority' => '',
+       'loadOrder' => '',
+       'module' => '',
+       'state' => 'stable',
+       'internal' => 1,
+       'uploadfolder' => 0,
+       'createDirs' => '',
+       'modify_tables' => '',
+       'clearCacheOnLoad' => 0,
+       'lockType' => '',
+       'author' => '',
+       'author_email' => '',
+       'author_company' => '',
+       'CGLcompliance' => '',
+       'CGLcompliance_note' => '',
+       'version' => '1.2.3',
+       '_md5_values_when_last_written' => '',
+       'constraints' => array(
+               'depends' => array(),
+               'conflicts' => array(),
+               'suggests' => array()
+       ),
+       'suggests' => array()
+);
+?>
\ No newline at end of file
diff --git a/typo3/sysext/core/Tests/Unit/Utility/Fixtures/clear.gif b/typo3/sysext/core/Tests/Unit/Utility/Fixtures/clear.gif
new file mode 100644 (file)
index 0000000..9ed1269
Binary files /dev/null and b/typo3/sysext/core/Tests/Unit/Utility/Fixtures/clear.gif differ
diff --git a/typo3/sysext/core/Tests/Unit/Utility/Fixtures/clear.png b/typo3/sysext/core/Tests/Unit/Utility/Fixtures/clear.png
new file mode 100644 (file)
index 0000000..b421b25
Binary files /dev/null and b/typo3/sysext/core/Tests/Unit/Utility/Fixtures/clear.png differ
index 3bb7353..7538afe 100644 (file)
@@ -209,8 +209,7 @@ class GeneralUtilityTest extends \tx_phpunit_testcase {
                if (!$GLOBALS['TYPO3_CONF_VARS']['GFX']['im'] || !$GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path_lzw']) {
                        $this->markTestSkipped('gifCompressFixesPermissionOfConvertedFileIfUsingImagemagick() test not available without imagemagick setup.');
                }
-               $testFinder = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_Phpunit_Service_TestFinder');
-               $fixtureGifFile = $testFinder->getAbsoluteCoreTestsPath() . 'Unit/t3lib/fixtures/clear.gif';
+               $fixtureGifFile = __DIR__ . '/Fixtures/clear.gif';
                $GLOBALS['TYPO3_CONF_VARS']['GFX']['gif_compress'] = TRUE;
                // Copy file to unique filename in typo3temp, set target permissions and run method
                $testFilename = ((PATH_site . 'typo3temp/') . uniqid('test_')) . '.gif';
@@ -231,8 +230,7 @@ class GeneralUtilityTest extends \tx_phpunit_testcase {
                if (TYPO3_OS == 'WIN') {
                        $this->markTestSkipped('gifCompressFixesPermissionOfConvertedFileIfUsingImagemagick() test not available on Windows.');
                }
-               $testFinder = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_Phpunit_Service_TestFinder');
-               $fixtureGifFile = $testFinder->getAbsoluteCoreTestsPath() . 'Unit/t3lib/fixtures/clear.gif';
+               $fixtureGifFile = __DIR__ . '/Fixtures/clear.gif';
                $GLOBALS['TYPO3_CONF_VARS']['GFX']['gdlib'] = TRUE;
                $GLOBALS['TYPO3_CONF_VARS']['GFX']['gdlib_png'] = FALSE;
                $GLOBALS['TYPO3_CONF_VARS']['GFX']['gif_compress'] = TRUE;
@@ -261,8 +259,7 @@ class GeneralUtilityTest extends \tx_phpunit_testcase {
                if (!$GLOBALS['TYPO3_CONF_VARS']['GFX']['im'] || !$GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path_lzw']) {
                        $this->markTestSkipped('pngToGifByImagemagickFixesPermissionsOfConvertedFile() test not available without imagemagick setup.');
                }
-               $testFinder = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_Phpunit_Service_TestFinder');
-               $fixturePngFile = $testFinder->getAbsoluteCoreTestsPath() . 'Unit/t3lib/fixtures/clear.png';
+               $fixturePngFile = __DIR__ . '/Fixtures/clear.png';
                $GLOBALS['TYPO3_CONF_VARS']['FE']['png_to_gif'] = TRUE;
                // Copy file to unique filename in typo3temp, set target permissions and run method
                $testFilename = ((PATH_site . 'typo3temp/') . uniqid('test_')) . '.png';
@@ -289,8 +286,7 @@ class GeneralUtilityTest extends \tx_phpunit_testcase {
                if (!$GLOBALS['TYPO3_CONF_VARS']['GFX']['im']) {
                        $this->markTestSkipped('readPngGifFixesPermissionsOfConvertedFile() test not available without imagemagick setup.');
                }
-               $testFinder = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_Phpunit_Service_TestFinder');
-               $testGifFile = $testFinder->getAbsoluteCoreTestsPath() . 'Unit/t3lib/fixtures/clear.gif';
+               $testGifFile = __DIR__ . '/Fixtures/clear.gif';
                // Set target permissions and run method
                $GLOBALS['TYPO3_CONF_VARS']['BE']['fileCreateMask'] = '0777';
                $newPngFile = \TYPO3\CMS\Core\Utility\GeneralUtility::read_png_gif($testGifFile, TRUE);