[TASK] Re-add unit tests for ExtensionCompatibilityTester 70/31370/3
authorSusanne Moog <typo3@susannemoog.de>
Fri, 20 Jun 2014 10:23:21 +0000 (12:23 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 5 Jul 2014 19:32:46 +0000 (21:32 +0200)
The tests for the ExtensionCompatibilityTester are currently skipped.
This patch removes the broken tests and leaves the working ones.

Releases: 6.3, 6.2
Resolves: #59700
Change-Id: I10a49d0dddf2807bd50944837e31f0105374c8c9
Reviewed-on: https://review.typo3.org/31370
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/install/Tests/Unit/Controller/Action/Ajax/ExtensionCompatibilityTesterTest.php

index 33317c6..de77658 100644 (file)
@@ -21,9 +21,6 @@ use TYPO3\CMS\Core\Utility;
  */
 class ExtensionCompatibilityTesterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
-       public function setUp() {
-               $this->markTestIncomplete('FIXME: rework to match package management change');
-       }
        /**
         * @var \TYPO3\CMS\Core\Package\UnitTestPackageManager A backup of unit test package manager
         */
@@ -57,6 +54,21 @@ class ExtensionCompatibilityTesterTest extends \TYPO3\CMS\Core\Tests\UnitTestCas
        /**
         * @test
         */
+       public function getExtensionsToLoadGetsExtensionsWithoutExcluded() {
+               $GLOBALS['TYPO3_LOADED_EXT'] = array(
+                       'cms' => '',
+                       'news' => '',
+                       'info' => ''
+               );
+               $extensionCompatibilityTesterMock = $this->getAccessibleMock('TYPO3\\CMS\\Install\\Controller\\Action\\Ajax\\ExtensionCompatibilityTester', array('getExtensionsToExclude'), array());
+               $extensionCompatibilityTesterMock->expects($this->once())->method('getExtensionsToExclude')->will($this->returnValue(array('cms', 'info')));
+               $result = $extensionCompatibilityTesterMock->_call('getExtensionsToLoad');
+               $this->assertEquals(array('news' => ''), $result);
+       }
+
+       /**
+        * @test
+        */
        public function executeActionReturnsStringOkIfAllIsWell() {
                $extensionCompatibilityTesterMock = $this->getAccessibleMock('TYPO3\\CMS\\Install\\Controller\\Action\\Ajax\\ExtensionCompatibilityTester', array('getExtensionsToLoad', 'tryToLoadExtLocalconfAndExtTablesOfExtensions', 'deleteProtocolFile'), array());
                $extensionCompatibilityTesterMock->expects($this->once())->method('getExtensionsToLoad')->will($this->returnValue(array()));
@@ -106,31 +118,7 @@ class ExtensionCompatibilityTesterTest extends \TYPO3\CMS\Core\Tests\UnitTestCas
                $this->assertFalse(file_exists(PATH_site . 'typo3temp/ExtensionCompatibilityTester.txt'));
        }
 
-       /**
-        * @test
-        */
-       public function getLoadedExtensionsReturnsArray() {
-               $extensionCompatibilityTesterMock = $this->getAccessibleMock('TYPO3\\CMS\\Install\\Controller\\Action\\Ajax\\ExtensionCompatibilityTester', array('dummy'), array());
-               $result = $extensionCompatibilityTesterMock->_call('getExtensionsToLoad');
-               $this->assertInternalType('array', $result);
-       }
 
-       /**
-        * @test
-        */
-       public function loadExtTablesForExtensionIncludesExtTablesPhp() {
-               $extension = array(
-                       'demo1' => array(
-                               'type' => 'L',
-                               'ext_tables.php' => PATH_typo3 . 'sysext/install/Tests/Unit/Controller/Action/Ajax/Fixtures/demo1/ext_tables.php'
-                       )
-               );
-               $extensionCompatibilityTesterMock = $this->getAccessibleMock('TYPO3\\CMS\\Install\\Controller\\Action\\Ajax\\ExtensionCompatibilityTester', array('dummy'), array());
-               $extensionCompatibilityTesterMock->_call('loadExtTablesForExtension', 'demo1', $extension['demo1']);
-               $this->assertArrayHasKey('demo1_executed', $GLOBALS);
-               $this->assertEquals('foobar', $GLOBALS['demo1_executed']);
-               unset($GLOBALS['demo1_executed']);
-       }
 
        /**
         * @test
@@ -215,7 +203,6 @@ class ExtensionCompatibilityTesterTest extends \TYPO3\CMS\Core\Tests\UnitTestCas
                $extensionCompatibilityTesterMock->_call('tryToLoadExtLocalconfAndExtTablesOfExtensions', $extension);
        }
 
-
        /**
         * @test
         */
@@ -229,18 +216,6 @@ class ExtensionCompatibilityTesterTest extends \TYPO3\CMS\Core\Tests\UnitTestCas
        /**
         * @test
         */
-       public function getExtensionsToLoadCallsGetExtensionsToExclude() {
-               $extensionCompatibilityTesterMock = $this->getAccessibleMock('TYPO3\\CMS\\Install\\Controller\\Action\\Ajax\\ExtensionCompatibilityTester', array('getExtensionsToExclude'), array());
-               $extensionCompatibilityTesterMock
-                       ->expects($this->once())
-                       ->method('getExtensionsToExclude')
-                       ->will($this->returnValue(array()));
-               $extensionCompatibilityTesterMock->_call('getExtensionsToLoad');
-       }
-
-       /**
-        * @test
-        */
        public function getExtensionsToExcludeReturnsArray() {
                $extensionCompatibilityTesterMock = $this->getAccessibleMock('TYPO3\\CMS\\Install\\Controller\\Action\\Ajax\\ExtensionCompatibilityTester', array('dummy'), array());
                $returnValue = $extensionCompatibilityTesterMock->_call('getExtensionsToExclude');