[TASK] Make tests use correct namespaces 27/23127/3
authorStefan Neufeind <typo3.neufeind@speedpartner.de>
Fri, 16 Aug 2013 09:41:01 +0000 (11:41 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 16 Aug 2013 10:54:37 +0000 (12:54 +0200)
Change-Id: I7cc308d3c5c59b1bf8922b6830cf29fb726caa56
Resolves: #51103
Releases: 6.2, 6.1, 6.0
Reviewed-on: https://review.typo3.org/23127
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
17 files changed:
typo3/sysext/core/Tests/Functional/Utility/File/ExtendedFileUtilityTest.php
typo3/sysext/core/Tests/Unit/Resource/Service/FrontendContentAdapterServiceTest.php
typo3/sysext/core/Tests/Unit/Tree/TableConfiguration/TreeDataProviderFactoryTest.php
typo3/sysext/core/Tests/Unit/Utility/ArrayUtilityTest.php
typo3/sysext/core/Tests/Unit/Utility/ExtensionMangementUtilityTest.php
typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php
typo3/sysext/core/Tests/Unit/Utility/VersionNumberUtilityTest.php
typo3/sysext/documentation/Tests/Unit/Domain/Model/DocumentFormatTest.php
typo3/sysext/documentation/Tests/Unit/Domain/Model/DocumentTest.php
typo3/sysext/documentation/Tests/Unit/Domain/Model/DocumentTranslationTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/Fixture/Model/Entity2.php
typo3/sysext/extbase/Tests/Unit/Persistence/Fixture/Model/Entity3.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/PersistenceManagerTest.php
typo3/sysext/form/Tests/Unit/Validation/FileMinimumSizeValidatorTest.php
typo3/sysext/form/Tests/Unit/Validation/GreaterThanValidatorTest.php
typo3/sysext/form/Tests/Unit/View/Mail/Html/Element/AbstractElementViewTest.php
typo3/sysext/scheduler/Tests/Unit/CronCommand/NormalizeCommandTest.php

index fce6651..4acf92b 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-namespace TYPO3\CMS\Core\Tests\Unit\Utility\File;
+namespace TYPO3\CMS\Core\Tests\Functional\Utility\File;
 
 /* * *************************************************************
  *  Copyright notice
index 6912fd8..ad93b38 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-namespace TYPO3\CMS\Core\Tests\Resource\Service;
+namespace TYPO3\CMS\Core\Tests\Unit\Resource\Service;
 
 /***************************************************************
  *  Copyright notice
index 939351a..9733dff 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-namespace TYPO3\CMS\Core\Tests\Tree\TableConfiguration;
+namespace TYPO3\CMS\Core\Tests\Unit\Tree\TableConfiguration;
 
 /***************************************************************
  *  Copyright notice
index 27a9f96..e44c4e5 100644 (file)
@@ -210,17 +210,16 @@ class ArrayUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function isValidPathReturnsTrueIfPathExists() {
-               $namespace = 'TYPO3\\CMS\\Core\\Utility';
                $className = uniqid('ArrayUtility');
                eval(
-                       'namespace ' . $namespace . ';' .
+                       'namespace ' . __NAMESPACE__ . ';' .
                        'class ' . $className . ' extends \\TYPO3\\CMS\\Core\\Utility\\ArrayUtility {' .
                        '  public static function getValueByPath() {' .
                        '    return 42;' .
                        '  }' .
                        '}'
                );
-               $className = $namespace . '\\' . $className;
+               $className = __NAMESPACE__ . '\\' . $className;
                $this->assertTrue($className::isValidPath(array('foo'), 'foo'));
        }
 
@@ -228,17 +227,16 @@ class ArrayUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function isValidPathReturnsFalseIfPathDoesNotExist() {
-               $namespace = 'TYPO3\\CMS\\Core\\Utility';
                $className = uniqid('ArrayUtility');
                eval(
-                       'namespace ' . $namespace . ';' .
+                       'namespace ' . __NAMESPACE__ . ';' .
                        'class ' . $className . ' extends \\TYPO3\\CMS\\Core\\Utility\\ArrayUtility {' .
                        '  public static function getValueByPath() {' .
                        '    throw new \RuntimeException(\'foo\', 123);' .
                        '  }' .
                        '}'
                );
-               $className = $namespace . '\\' . $className;
+               $className = __NAMESPACE__ . '\\' . $className;
                $this->assertFalse($className::isValidPath(array('foo'), 'foo'));
        }
 
index b6ed866..6602560 100644 (file)
@@ -91,11 +91,10 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @TODO: Move this to a fixture file
         */
        protected function createAccessibleProxyClass() {
-               $namespace = 'TYPO3\\CMS\\Core\\Utility';
                $className = 'ExtensionManagementUtilityAccessibleProxy';
-               if (!class_exists($namespace . '\\' . $className, FALSE)) {
+               if (!class_exists(__NAMESPACE__ . '\\' . $className, FALSE)) {
                        eval(
-                               'namespace ' . $namespace . ';' .
+                               'namespace ' . __NAMESPACE__ . ';' .
                                'class ' . $className . ' extends \\TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility {' .
                                '  public static function createTypo3LoadedExtensionInformationArray() {' .
                                '    return parent::createTypo3LoadedExtensionInformationArray();' .
@@ -701,7 +700,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @dataProvider createTypo3LoadedExtensionInformationArrayReturnsExpectedInformationForCmsExtensionDataProvider
         */
        public function createTypo3LoadedExtensionInformationArrayReturnsExpectedInformationForCmsExtension($arrayKeyToTest, $expectedContent) {
-               $actualArray = \TYPO3\CMS\Core\Utility\ExtensionManagementUtilityAccessibleProxy::createTypo3LoadedExtensionInformationArray();
+               $actualArray = ExtensionManagementUtilityAccessibleProxy::createTypo3LoadedExtensionInformationArray();
                $this->assertStringEndsWith($expectedContent, $actualArray['cms'][$arrayKeyToTest]);
        }
 
@@ -713,7 +712,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         */
        public function getTypo3LoadedExtensionInformationCacheIdentifierCreatesSha1WithFourtyCharactersAndPrefix() {
                $prefix = 'loaded_extensions_';
-               $identifier = \TYPO3\CMS\Core\Utility\ExtensionManagementUtilityAccessibleProxy::getTypo3LoadedExtensionInformationCacheIdentifier();
+               $identifier = ExtensionManagementUtilityAccessibleProxy::getTypo3LoadedExtensionInformationCacheIdentifier();
                $this->assertStringStartsWith($prefix, $identifier);
                $sha1 = str_replace($prefix, '', $identifier);
                $this->assertEquals(40, strlen($sha1));
@@ -766,7 +765,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                                'ext_localconf.php' => $extLocalconfLocation
                        )
                );
-               \TYPO3\CMS\Core\Utility\ExtensionManagementUtilityAccessibleProxy::loadSingleExtLocalconfFiles();
+               ExtensionManagementUtilityAccessibleProxy::loadSingleExtLocalconfFiles();
        }
 
        /////////////////////////////////////////
@@ -796,7 +795,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                $GLOBALS['typo3CacheManager'] = $this->getMock('TYPO3\\CMS\\Core\\Cache\\CacheManager', array('getCache'));
                $GLOBALS['typo3CacheManager']->expects($this->any())->method('getCache')->will($this->returnValue($mockCache));
                $mockCache->expects($this->once())->method('set')->with($this->anything(), $this->stringContains($uniqueStringInLocalconf), $this->anything());
-               \TYPO3\CMS\Core\Utility\ExtensionManagementUtilityAccessibleProxy::createExtLocalconfCacheEntry();
+               ExtensionManagementUtilityAccessibleProxy::createExtLocalconfCacheEntry();
        }
 
        /**
@@ -819,7 +818,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                $mockCache->expects($this->once())
                        ->method('set')
                        ->with($this->anything(), $this->logicalNot($this->stringContains($extensionName)), $this->anything());
-               \TYPO3\CMS\Core\Utility\ExtensionManagementUtilityAccessibleProxy::createExtLocalconfCacheEntry();
+               ExtensionManagementUtilityAccessibleProxy::createExtLocalconfCacheEntry();
        }
 
        /**
@@ -836,7 +835,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                $GLOBALS['typo3CacheManager'] = $this->getMock('TYPO3\\CMS\\Core\\Cache\\CacheManager', array('getCache'));
                $GLOBALS['typo3CacheManager']->expects($this->any())->method('getCache')->will($this->returnValue($mockCache));
                $mockCache->expects($this->once())->method('set')->with($this->anything(), $this->anything(), $this->equalTo(array()));
-               \TYPO3\CMS\Core\Utility\ExtensionManagementUtilityAccessibleProxy::createExtLocalconfCacheEntry();
+               ExtensionManagementUtilityAccessibleProxy::createExtLocalconfCacheEntry();
        }
 
        /////////////////////////////////////////
@@ -847,7 +846,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         */
        public function getExtLocalconfCacheIdentifierCreatesSha1WithFourtyCharactersAndPrefix() {
                $prefix = 'ext_localconf_';
-               $identifier = \TYPO3\CMS\Core\Utility\ExtensionManagementUtilityAccessibleProxy::getExtLocalconfCacheIdentifier();
+               $identifier = ExtensionManagementUtilityAccessibleProxy::getExtLocalconfCacheIdentifier();
                $this->assertStringStartsWith($prefix, $identifier);
                $sha1 = str_replace($prefix, '', $identifier);
                $this->assertEquals(40, strlen($sha1));
@@ -944,7 +943,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         */
        public function getBaseTcaCacheIdentifierCreatesSha1WithFourtyCharactersAndPrefix() {
                $prefix = 'tca_base_';
-               $identifier = \TYPO3\CMS\Core\Utility\ExtensionManagementUtilityAccessibleProxy::getBaseTcaCacheIdentifier();
+               $identifier = ExtensionManagementUtilityAccessibleProxy::getBaseTcaCacheIdentifier();
                $this->assertStringStartsWith($prefix, $identifier);
                $sha1 = str_replace($prefix, '', $identifier);
                $this->assertEquals(40, strlen($sha1));
@@ -979,7 +978,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                $mockCache->expects($this->once())->method('requireOnce');
                // Reset the internal cache access tracking variable of extMgm
                // This method is only in the ProxyClass!
-               \TYPO3\CMS\Core\Utility\ExtensionManagementUtilityAccessibleProxy::resetExtTablesWasReadFromCacheOnceBoolean();
+               ExtensionManagementUtilityAccessibleProxy::resetExtTablesWasReadFromCacheOnceBoolean();
                ExtensionManagementUtility::loadExtTables(TRUE);
        }
 
@@ -1010,7 +1009,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                $GLOBALS['typo3CacheManager'] = $this->getMock('TYPO3\\CMS\\Core\\Cache\\CacheManager', array('getCache'));
                $GLOBALS['typo3CacheManager']->expects($this->any())->method('getCache')->will($this->returnValue($mockCache));
                $mockCache->expects($this->once())->method('set')->with($this->anything(), $this->stringContains($uniqueStringInTables), $this->anything());
-               \TYPO3\CMS\Core\Utility\ExtensionManagementUtilityAccessibleProxy::createExtTablesCacheEntry();
+               ExtensionManagementUtilityAccessibleProxy::createExtTablesCacheEntry();
        }
 
        /**
@@ -1033,7 +1032,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                $mockCache->expects($this->once())
                        ->method('set')
                        ->with($this->anything(), $this->logicalNot($this->stringContains($extensionName)), $this->anything());
-               \TYPO3\CMS\Core\Utility\ExtensionManagementUtilityAccessibleProxy::createExtTablesCacheEntry();
+               ExtensionManagementUtilityAccessibleProxy::createExtTablesCacheEntry();
        }
 
        /**
@@ -1050,7 +1049,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                $GLOBALS['typo3CacheManager'] = $this->getMock('TYPO3\\CMS\\Core\\Cache\\CacheManager', array('getCache'));
                $GLOBALS['typo3CacheManager']->expects($this->any())->method('getCache')->will($this->returnValue($mockCache));
                $mockCache->expects($this->once())->method('set')->with($this->anything(), $this->anything(), $this->equalTo(array()));
-               \TYPO3\CMS\Core\Utility\ExtensionManagementUtilityAccessibleProxy::createExtTablesCacheEntry();
+               ExtensionManagementUtilityAccessibleProxy::createExtTablesCacheEntry();
        }
 
        /////////////////////////////////////////
@@ -1061,7 +1060,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         */
        public function getExtTablesCacheIdentifierCreatesSha1WithFourtyCharactersAndPrefix() {
                $prefix = 'ext_tables_';
-               $identifier = \TYPO3\CMS\Core\Utility\ExtensionManagementUtilityAccessibleProxy::getExtTablesCacheIdentifier();
+               $identifier = ExtensionManagementUtilityAccessibleProxy::getExtTablesCacheIdentifier();
                $this->assertStringStartsWith($prefix, $identifier);
                $sha1 = str_replace($prefix, '', $identifier);
                $this->assertEquals(40, strlen($sha1));
@@ -1163,17 +1162,16 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @test
         */
        public function getExtensionVersionForLoadedExtensionReturnsExtensionVersion() {
-               $namespace = 'TYPO3\\CMS\\Core\\Utility';
                $className = uniqid('ExtensionManagementUtility');
                eval(
-                       'namespace ' . $namespace .';' .
+                       'namespace ' . __NAMESPACE__ .';' .
                        'class ' . $className . ' extends \\TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility {' .
                        '  public static function isLoaded() {' .
                        '    return TRUE;' .
                        '  }' .
                        '}'
                );
-               $className = $namespace . '\\' . $className;
+               $className = __NAMESPACE__ . '\\' . $className;
                ExtensionManagementUtility::clearExtensionKeyMap();
                $uniqueSuffix = uniqid('test');
                $extensionKey = 'unloadedextension' . $uniqueSuffix;
@@ -1214,17 +1212,16 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @test
         */
        public function getLoadedExtensionListArrayConsidersRequiredExtensions() {
-               $namespace = 'TYPO3\\CMS\\Core\\Utility';
                $className = uniqid('ExtensionManagementUtility');
                eval(
-                       'namespace ' . $namespace . ';' .
+                       'namespace ' . __NAMESPACE__ . ';' .
                        'class ' . $className . ' extends \\TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility {' .
                        '  public static function getRequiredExtensionListArray() {' .
                        '    return array(\'baz\');' .
                        '  }' .
                        '}'
                );
-               $className = $namespace . '\\' . $className;
+               $className = __NAMESPACE__ . '\\' . $className;
                $GLOBALS['TYPO3_CONF_VARS']['EXT']['extListArray'] = array();
                $this->assertEquals(array('baz'), $className::getLoadedExtensionListArray());
        }
@@ -1233,17 +1230,16 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @test
         */
        public function getLoadedExtensionListArrayReturnsUniqueList() {
-               $namespace = 'TYPO3\\CMS\\Core\\Utility';
                $className = uniqid('ExtensionManagementUtility');
                eval(
-                       'namespace ' . $namespace . ';' .
+                       'namespace ' . __NAMESPACE__ . ';' .
                        'class ' . $className . ' extends \\TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility {' .
                        '  public static function getRequiredExtensionListArray() {' .
                        '    return array(\'bar\');' .
                        '  }' .
                        '}'
                );
-               $className = $namespace . '\\' . $className;
+               $className = __NAMESPACE__ . '\\' . $className;
                $GLOBALS['TYPO3_CONF_VARS']['EXT']['extListArray'] = array('foo', 'bar', 'foo');
                $this->assertSame(array('bar', 'foo'), $className::getLoadedExtensionListArray());
        }
@@ -1293,17 +1289,16 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @expectedException \RuntimeException
         */
        public function loadExtensionThrowsExceptionIfExtensionIsLoaded() {
-               $namespace = 'TYPO3\\CMS\\Core\\Utility';
                $className = uniqid('ExtensionManagementUtility');
                eval(
-                       'namespace ' . $namespace . ';' .
+                       'namespace ' . __NAMESPACE__ . ';' .
                        'class ' . $className . ' extends \\TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility {' .
                        '  public static function isLoaded() {' .
                        '    return TRUE;' .
                        '  }' .
                        '}'
                );
-               $className = $namespace . '\\' . $className;
+               $className = __NAMESPACE__ . '\\' . $className;
                $className::loadExtension('test');
        }
 
@@ -1316,10 +1311,9 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                        $this->markTestSkipped('Test is not available until update wizard to transform localconf.php was run.');
                }
                $extensionKeyToLoad = uniqid('loadMe');
-               $namespace = 'TYPO3\\CMS\\Core\\Utility';
                $className = uniqid('ExtensionManagementUtility');
                eval(
-                       'namespace ' . $namespace . ';' .
+                       'namespace ' . __NAMESPACE__ . ';' .
                        'class ' . $className . ' extends \\TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility {' .
                        '  public static function writeNewExtensionList($extList) {' .
                        '    if (in_array(' . $extensionKeyToLoad . ', $extList)) {' .
@@ -1328,7 +1322,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                        '  }' .
                        '}'
                );
-               $className = $namespace . '\\' . $className;
+               $className = __NAMESPACE__ . '\\' . $className;
                $className::loadExtension($extensionKeyToLoad);
        }
 
@@ -1340,17 +1334,16 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * @expectedException \RuntimeException
         */
        public function unloadExtensionThrowsExceptionIfExtensionIsNotLoaded() {
-               $namespace = 'TYPO3\\CMS\\Core\\Utility';
                $className = uniqid('ExtensionManagementUtility');
                eval(
-                       'namespace ' . $namespace . ';' .
+                       'namespace ' . __NAMESPACE__ . ';' .
                        'class ' . $className . ' extends \\TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility {' .
                        '  public static function isLoaded() {' .
                        '    return FALSE;' .
                        '  }' .
                        '}'
                );
-               $className = $namespace . '\\' . $className;
+               $className = __NAMESPACE__ . '\\' . $className;
                $className::unloadExtension('test');
        }
 
@@ -1360,10 +1353,9 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         */
        public function unloadExtensionThrowsExceptionIfExtensionIsRequired() {
                $extensionKey = uniqid('test');
-               $namespace = 'TYPO3\\CMS\\Core\\Utility';
                $className = uniqid('ExtensionManagementUtility');
                eval(
-                       'namespace ' . $namespace . ';' .
+                       'namespace ' . __NAMESPACE__ . ';' .
                        'class ' . $className . ' extends \\TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility {' .
                        '  public static function isLoaded() {' .
                        '    return TRUE;' .
@@ -1373,7 +1365,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                        '  }' .
                        '}'
                );
-               $className = $namespace . '\\' . $className;
+               $className = __NAMESPACE__ . '\\' . $className;
                $className::unloadExtension($extensionKey);
        }
 
@@ -1386,10 +1378,9 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                        $this->markTestSkipped('Test is not available until update wizard to transform localconf.php was run.');
                }
                $extensionKeyToUnload = uniqid('unloadMe');
-               $namespace = 'TYPO3\\CMS\\Core\\Utility';
                $className = uniqid('ExtensionManagementUtility');
                eval(
-                       'namespace ' . $namespace . ';' .
+                       'namespace ' . __NAMESPACE__ . ';' .
                        'class ' . $className . ' extends \\TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility {' .
                        '  public static function isLoaded() {' .
                        '    return TRUE;' .
@@ -1401,7 +1392,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                        '  }' .
                        '}'
                );
-               $className = $namespace . '\\' . $className;
+               $className = __NAMESPACE__ . '\\' . $className;
                $className::unloadExtension($extensionKeyToUnload);
        }
 
index b0f2e5a..50f5c0f 100644 (file)
@@ -2536,10 +2536,9 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function minifyJavaScriptWritesExceptionMessageToDevLog() {
-               $namespace = 'TYPO3\\CMS\\Core\\Utility';
                $t3libDivMock = uniqid('GeneralUtility');
-               eval('namespace ' . $namespace . '; class ' . $t3libDivMock . ' extends \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility {' . '  public static function devLog($errorMessage) {' . '    if (!($errorMessage === \'Error minifying java script: foo\')) {' . '      throw new \\UnexpectedValue(\'broken\');' . '    }' . '    throw new \\RuntimeException();' . '  }' . '}');
-               $t3libDivMock = $namespace . '\\' . $t3libDivMock;
+               eval('namespace ' . __NAMESPACE__ . '; class ' . $t3libDivMock . ' extends \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility {' . '  public static function devLog($errorMessage) {' . '    if (!($errorMessage === \'Error minifying java script: foo\')) {' . '      throw new \\UnexpectedValue(\'broken\');' . '    }' . '    throw new \\RuntimeException();' . '  }' . '}');
+               $t3libDivMock = __NAMESPACE__ . '\\' . $t3libDivMock;
                $hookClassName = uniqid('tx_coretest');
                $minifyHookMock = $this->getMock('stdClass', array('minify'), array(), $hookClassName);
                $functionName = '&' . $hookClassName . '->minify';
index e48212e..36f587f 100644 (file)
@@ -131,10 +131,9 @@ class VersionNumberUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @param string $expectedVersion
         */
        public function getNumericTypo3VersionNumber($currentVersion, $expectedVersion) {
-               $namespace = 'TYPO3\\CMS\\Core\\Utility';
                $className = uniqid('VersionNumberUtility');
-               eval('namespace ' . $namespace . '; class ' . $className . ' extends \\TYPO3\\CMS\\Core\\Utility\\VersionNumberUtility {' . '  protected static function getCurrentTypo3Version() {' . '    return \'' . $currentVersion . '\';' . '  }' . '}');
-               $className = $namespace . '\\' . $className;
+               eval('namespace ' . __NAMESPACE__ . '; class ' . $className . ' extends \\TYPO3\\CMS\\Core\\Utility\\VersionNumberUtility {' . '  protected static function getCurrentTypo3Version() {' . '    return \'' . $currentVersion . '\';' . '  }' . '}');
+               $className = __NAMESPACE__ . '\\' . $className;
                $version = $className::getNumericTypo3Version();
                $this->assertEquals($expectedVersion, $version);
        }
index 66d7f0d..b552607 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-namespace TYPO3\CMS\Documentation\Tests;
+namespace TYPO3\CMS\Documentation\Tests\Unit\Domain\Model;
 
 /***************************************************************
  *  Copyright notice
index 203b58d..483a075 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-namespace TYPO3\CMS\Documentation\Tests;
+namespace TYPO3\CMS\Documentation\Tests\Unit\Domain\Model;
 
 /***************************************************************
  *  Copyright notice
index 4242752..4319cf7 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-namespace TYPO3\CMS\Documentation\Tests;
+namespace TYPO3\CMS\Documentation\Tests\Unit\Domain\Model;
 
 /***************************************************************
  *  Copyright notice
index 9b6542b..6468ac1 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-namespace TYPO3\CMS\Extbase\Tests\Persistence\Fixture\Model;
+namespace TYPO3\CMS\Extbase\Tests\Unit\Persistence\Fixture\Model;
 
 /***************************************************************
  *  Copyright notice
@@ -47,7 +47,7 @@ class Entity2 extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        public $someInteger;
 
        /**
-        * @var \TYPO3\CMS\Extbase\Tests\Persistence\Fixture\Model\Entity3
+        * @var \TYPO3\CMS\Extbase\Tests\Unit\Persistence\Fixture\Model\Entity3
         */
        public $someReference;
 
index 6b2d64b..4b2e07c 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-namespace TYPO3\CMS\Extbase\Tests\Persistence\Fixture\Model;
+namespace TYPO3\CMS\Extbase\Tests\Unit\Persistence\Fixture\Model;
 
 /*                                                                        *
  * This script belongs to the TYPO3 Flow framework.                       *
index 7af6bb0..ac5ebe7 100644 (file)
@@ -39,7 +39,7 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
         * @test
         */
        public function persistAllPassesAddedObjectsToBackend() {
-               $entity2 = new \TYPO3\CMS\Extbase\Tests\Persistence\Fixture\Model\Entity2();
+               $entity2 = new \TYPO3\CMS\Extbase\Tests\Unit\Persistence\Fixture\Model\Entity2();
                $objectStorage = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
                $objectStorage->attach($entity2);
                $mockBackend = $this->getMock('TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface');
@@ -56,7 +56,7 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
         * @test
         */
        public function persistAllPassesRemovedObjectsToBackend() {
-               $entity2 = new \TYPO3\CMS\Extbase\Tests\Persistence\Fixture\Model\Entity2();
+               $entity2 = new \TYPO3\CMS\Extbase\Tests\Unit\Persistence\Fixture\Model\Entity2();
                $objectStorage = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
                $objectStorage->attach($entity2);
                $mockBackend = $this->getMock('TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface');
@@ -218,17 +218,17 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
        public function updateSchedulesAnObjectForPersistence() {
                $className = uniqid('BazFixture');
                eval ('
-                       namespace Foo\\Bar\\Domain\\Model;
+                       namespace ' . __NAMESPACE__ . '\\Domain\\Model;
                        class ' . $className . ' extends \\TYPO3\\CMS\\Extbase\\DomainObject\\AbstractEntity {
                                protected $uid = 42;
                        }
                ');
                eval ('
-                       namespace Foo\\Bar\\Domain\\Repository;
+                       namespace ' . __NAMESPACE__ . '\\Domain\\Repository;
                        class  ' . $className . 'Repository extends \\TYPO3\\CMS\\Extbase\\Persistence\\Repository {}
                ');
-               $classNameWithNamespace = 'Foo\\Bar\\Domain\\Model\\' . $className;
-               $repositorClassNameWithNamespace = 'Foo\\Bar\\Domain\\Repository\\' . $className . 'Repository';
+               $classNameWithNamespace = __NAMESPACE__ . '\\Domain\\Model\\' . $className;
+               $repositorClassNameWithNamespace = __NAMESPACE__ . '\\Domain\\Repository\\' . $className . 'Repository';
 
                $persistenceManager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy'));
                $session = new \TYPO3\CMS\Extbase\Persistence\Generic\Session();
@@ -337,16 +337,16 @@ class PersistenceManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase
        public function persistAllAddsNamespacedReconstitutedObjectFromSessionToBackendsAggregateRootObjects() {
                $className = uniqid('BazFixture');
                eval ('
-                       namespace Foo\\Bar\\Domain\\Model;
+                       namespace ' . __NAMESPACE__ . '\\Domain\\Model;
                        class ' . $className . ' extends \\TYPO3\\CMS\\Extbase\\DomainObject\\AbstractEntity {}
                ');
                eval ('
-                       namespace Foo\\Bar\\Domain\\Repository;
+                       namespace ' . __NAMESPACE__ . '\\Domain\\Repository;
                        class  ' . $className . 'Repository {}
                ');
                $persistenceManager = $this->getAccessibleMock('TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager', array('dummy'));
                $aggregateRootObjects = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
-               $classNameWithNamespace = 'Foo\\Bar\\Domain\\Model\\' . $className;
+               $classNameWithNamespace = __NAMESPACE__ . '\\Domain\\Model\\' . $className;
                $entity1 = new $classNameWithNamespace();
                $aggregateRootObjects->attach($entity1);
                $mockBackend = $this->getMock($this->buildAccessibleProxy('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Backend'), array('commit', 'setAggregateRootObjects', 'setDeletedEntities'), array(), '', FALSE);
index 75a2652..21f21ee 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+namespace TYPO3\CMS\Form\Tests\Unit\Validation;
+
 /***************************************************************
 *  Copyright notice
 *
index 9a5d306..911ee1d 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+namespace TYPO3\CMS\Form\Tests\Unit\Validation;
+
 /***************************************************************
 *  Copyright notice
 *
index 6f6a585..1f22799 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-namespace TYPO3\CMS\Form\Tests\View\Mail\Html\Element;
+namespace TYPO3\CMS\Form\Tests\Unit\View\Mail\Html\Element;
 
 /***************************************************************
  *  Copyright notice
index e6d2e3c..514fc24 100644 (file)
@@ -37,11 +37,11 @@ class NormalizeCommandTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        protected function getAccessibleProxy() {
                $className = 'NormalizeCommand' . uniqid();
-               $fullClassName = 'TYPO3\\CMS\\Scheduler\\CronCommand\\' . $className;
+               $fullClassName = __NAMESPACE__ . '\\' . $className;
                if (!class_exists($className, FALSE)) {
                        eval(
-                               'namespace TYPO3\CMS\Scheduler\CronCommand;' .
-                               'class ' . $className . ' extends NormalizeCommand {' .
+                               'namespace ' . __NAMESPACE__ . ';' .
+                               'class ' . $className . ' extends \\TYPO3\\CMS\\Scheduler\\CronCommand\\NormalizeCommand {' .
                                '  public static function convertKeywordsToCronCommand($cronCommand) {' .
                                '    return parent::convertKeywordsToCronCommand($cronCommand);' .
                                '  }' .