[BUGFIX] EXT:reports does not recognize TYPO3 CMS 7.3.0 as released 66/40466/6
authorXavier Perseguers <xavier@typo3.org>
Fri, 19 Jun 2015 11:35:54 +0000 (13:35 +0200)
committerBenjamin Mack <benni@typo3.org>
Mon, 22 Jun 2015 10:28:07 +0000 (12:28 +0200)
Since the versioning scheme for TYPO3 CMS branches has changed with the
kickstart of TYPO3 CMS 7 LTS development, the structure of the JSON feed
http://get.typo3.org/json has been adapted accordingly and needs to be
taken into account in EXT:reports.

Read more:
https://typo3.org/teams/core-development-team/resources/release-lifecycle/

Change-Id: Ib9e542b9c54abb4a16f68597f04c8d56f94608be
Releases: master
Resolves: #67617
Reviewed-on: http://review.typo3.org/40466
Tested-by: Michael Schams <typo3@2015.trash.schams.net>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
Reviewed-by: Frederic Gaus <frederic.gaus@flagbit.de>
Tested-by: Frederic Gaus <frederic.gaus@flagbit.de>
Reviewed-by: Benjamin Mack <benni@typo3.org>
typo3/sysext/install/Classes/Service/CoreVersionService.php
typo3/sysext/install/Tests/Unit/Service/CoreVersionServiceTest.php
typo3/sysext/install/Tests/Unit/Service/Fixtures/VersionMatrixFixture.php

index 06baefe..6950577 100644 (file)
@@ -64,10 +64,10 @@ class CoreVersionService {
        public function updateVersionMatrix() {
                $versionArray = $this->fetchVersionMatrixFromRemote();
                // This is a 'hack' to keep the string stored in the registry small. We are usually only
-               // interested in information from 6.2 and up and older releases do not matter in current
+               // interested in information from 7 and up and older releases do not matter in current
                // use cases. If this unset() is removed and everything is stored for some reason, the
                // table sys_file field entry_value needs to be extended from blob to longblob.
-               unset($versionArray['6.1'], $versionArray['6.0'], $versionArray['4.7'], $versionArray['4.6'],
+               unset($versionArray['6.2'], $versionArray['6.1'], $versionArray['6.0'], $versionArray['4.7'], $versionArray['4.6'],
                        $versionArray['4.5'], $versionArray['4.4'], $versionArray['4.3'], $versionArray['4.2'],
                        $versionArray['4.1'], $versionArray['4.0'], $versionArray['3.8'], $versionArray['3.7'],
                        $versionArray['3.6'], $versionArray['3.5'], $versionArray['3.3']);
@@ -95,10 +95,10 @@ class CoreVersionService {
        public function getTarGzSha1OfVersion($version) {
                $this->ensureVersionExistsInMatrix($version);
 
-               $minorVersion = $this->getMinorVersion($version);
+               $majorVersion = $this->getMajorVersion($version);
                $versionMatrix = $this->getVersionMatrix();
 
-               if (empty($versionMatrix[$minorVersion]['releases'][$version]['checksums']['tar']['sha1'])) {
+               if (empty($versionMatrix[$majorVersion]['releases'][$version]['checksums']['tar']['sha1'])) {
                        throw new Exception\CoreVersionServiceException(
                                'Release sha1 of version ' . $version . ' not found in version matrix.'
                                . ' This is probably a bug on get.typo3.org.',
@@ -106,7 +106,7 @@ class CoreVersionService {
                        );
                }
 
-               return $versionMatrix[$minorVersion]['releases'][$version]['checksums']['tar']['sha1'];
+               return $versionMatrix[$majorVersion]['releases'][$version]['checksums']['tar']['sha1'];
        }
 
        /**
@@ -124,9 +124,9 @@ class CoreVersionService {
         * @return bool TRUE if version is actively maintained
         */
        public function isVersionActivelyMaintained() {
-               $minorVersion = $this->getInstalledMinorVersion();
+               $majorVersion = $this->getInstalledMajorVersion();
                $versionMatrix = $this->getVersionMatrix();
-               return (bool)$versionMatrix[$minorVersion]['active'];
+               return (bool)$versionMatrix[$majorVersion]['active'];
        }
 
        /**
@@ -135,13 +135,9 @@ class CoreVersionService {
         * @return bool TRUE if younger patch release is exists
         */
        public function isYoungerPatchReleaseAvailable() {
-               $result = FALSE;
                $version = $this->getInstalledVersion();
                $youngestVersion = $this->getYoungestPatchRelease();
-               if ($youngestVersion !== $version) {
-                       $result = TRUE;
-               }
-               return $result;
+               return $youngestVersion !== $version;
        }
 
        /**
@@ -175,7 +171,7 @@ class CoreVersionService {
        }
 
        /**
-        * Youngest patch release, eg. 6.2.2
+        * Youngest patch release, e.g., 6.2.2
         *
         * @return string Version string of youngest patch level release
         */
@@ -184,7 +180,7 @@ class CoreVersionService {
        }
 
        /**
-        * Youngest development patch release, eg. 6.2.0alpha3 or 6.2-snapshot-20131004
+        * Youngest development patch release, e.g., 6.2.0alpha3 or 6.2-snapshot-20131004
         *
         * @return string
         */
@@ -198,18 +194,18 @@ class CoreVersionService {
         *
         * @param array $types List of allowed types: development, release, security, regular
         * @throws Exception\CoreVersionServiceException
-        * @return string Youngest release, eg. 6.2.3 or 6.2.alpha3
+        * @return string Youngest release, e.g., 7.2.0alpha3 or 7.3.0
         */
        protected function getYoungestReleaseByType(array $types) {
                $version = $this->getInstalledVersion();
 
-               $minorVersion = $this->getMinorVersion($version);
+               $majorVersion = $this->getMajorVersion($version);
                $versionMatrix = $this->getVersionMatrix();
 
                $youngestRelease = $version;
                $versionReleaseTimestamp = $this->getReleaseTimestampOfVersion($version);
 
-               $patchLevelVersions = $versionMatrix[$minorVersion]['releases'];
+               $patchLevelVersions = $versionMatrix[$majorVersion]['releases'];
                foreach ($patchLevelVersions as $aVersionNumber => $aVersionDetails) {
                        if (!array_key_exists('type', $aVersionDetails)) {
                                throw new Exception\CoreVersionServiceException(
@@ -232,24 +228,23 @@ class CoreVersionService {
        }
 
        /**
-        * Get 'minor version' from version string, eg '6.2' from '6.2.2'
+        * Get 'major version' from installed version of TYPO3, e.g., '7' from '7.3.0'
         *
-        * @return string For example 6.2
+        * @return string For example 7
         */
-       protected function getInstalledMinorVersion() {
-               return $this->getMinorVersion($this->getInstalledVersion());
+       protected function getInstalledMajorVersion() {
+               return $this->getMajorVersion($this->getInstalledVersion());
        }
 
        /**
-        * Get 'minor version' of version, eg. '6.2' from '6.2.2'
+        * Get 'major version' of version, e.g., '7' from '7.3.0'
         *
         * @param string $version to check
-        * @return string Minor version, eg. '6.2'
+        * @return string Major version, e.g., '7'
         */
-       protected function getMinorVersion($version) {
+       protected function getMajorVersion($version) {
                $explodedVersion = explode('.', $version);
-               $minor = explode('-', $explodedVersion[1]);
-               return $explodedVersion[0] . '.' . $minor[0];
+               return $explodedVersion[0];
        }
 
        /**
@@ -290,21 +285,21 @@ class CoreVersionService {
        /**
         * Returns release timestamp of a specific version
         *
-        * @param $version String to check in version matrix, eg. 6.2.0alpha3 or 6.2.2
+        * @param $version String to check in version matrix, e.g., 7.2.0alpha3 or 7.3.0
         * @throws Exception\CoreVersionServiceException
         * @return int Timestamp of release
         */
        protected function getReleaseTimestampOfVersion($version) {
-               $minorVersion = $this->getMinorVersion($version);
+               $majorVersion = $this->getMajorVersion($version);
                $versionMatrix = $this->getVersionMatrix();
                $this->ensureVersionExistsInMatrix($version);
-               if (!array_key_exists('date', $versionMatrix[$minorVersion]['releases'][$version])) {
+               if (!array_key_exists('date', $versionMatrix[$majorVersion]['releases'][$version])) {
                        throw new Exception\CoreVersionServiceException(
                                'Release date of version ' . $version . ' not found in version matrix. This is probably a bug on get.typo3.org',
                                1380905853
                        );
                }
-               $dateString = $versionMatrix[$minorVersion]['releases'][$version]['date'];
+               $dateString = $versionMatrix[$majorVersion]['releases'][$version]['date'];
                $date = new \DateTime($dateString);
                return $date->getTimestamp();
        }
@@ -312,19 +307,19 @@ class CoreVersionService {
        /**
         * Throws an exception if specified version does not exist in version matrix
         *
-        * @param $version String to check in version matrix, eg. 6.2.0alpha3 or 6.2.2
+        * @param $version String to check in version matrix, e.g., 7.2.0alpha3 or 7.3.0
         * @throws Exception\CoreVersionServiceException
         */
        protected function ensureVersionExistsInMatrix($version) {
-               $minorVersion = $this->getMinorVersion($version);
+               $majorVersion = $this->getMajorVersion($version);
                $versionMatrix = $this->getVersionMatrix();
-               if (!array_key_exists($minorVersion, $versionMatrix)) {
+               if (!array_key_exists($majorVersion, $versionMatrix)) {
                        throw new Exception\CoreVersionServiceException(
-                               'Minor release ' . $minorVersion . ' not found in version matrix.',
+                               'Major release ' . $majorVersion . ' not found in version matrix.',
                                1380905851
                        );
                }
-               if (!array_key_exists($version, $versionMatrix[$minorVersion]['releases'])) {
+               if (!array_key_exists($version, $versionMatrix[$majorVersion]['releases'])) {
                        throw new Exception\CoreVersionServiceException(
                                'Patch level release ' . $version . ' not found in version matrix.',
                                1380905852
index be455e6..0f0aae1 100644 (file)
@@ -14,19 +14,22 @@ namespace TYPO3\CMS\Install\Service;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\Registry;
+use TYPO3\CMS\Core\Tests\UnitTestCase;
+
 /**
  * Test case
  */
-class CoreVersionServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
+class CoreVersionServiceTest extends UnitTestCase {
 
        /**
         * @test
         */
        public function updateVersionMatrixStoresVersionMatrixInRegistry() {
-               /** @var $instance \TYPO3\CMS\Install\Service\CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
-               $instance = $this->getAccessibleMock(\TYPO3\CMS\Install\Service\CoreVersionService::class, array('fetchVersionMatrixFromRemote'), array(), '', FALSE);
-               $registry = $this->getMock(\TYPO3\CMS\Core\Registry::class);
-               $versionArray = array($this->getUniqueId());
+               /** @var $instance CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
+               $instance = $this->getAccessibleMock(CoreVersionService::class, array('fetchVersionMatrixFromRemote'), array(), '', FALSE);
+               $registry = $this->getMock(Registry::class);
+               $versionArray = array(7 => []);
                $registry->expects($this->once())->method('set')->with('TYPO3.CMS.Install', 'coreVersionMatrix', $versionArray);
                $instance->_set('registry', $registry);
                $instance->expects($this->once())->method('fetchVersionMatrixFromRemote')->will($this->returnValue($versionArray));
@@ -37,17 +40,17 @@ class CoreVersionServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function updateVersionMatrixRemovesOldReleasesFromMatrix() {
-               /** @var $instance \TYPO3\CMS\Install\Service\CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
-               $instance = $this->getAccessibleMock(\TYPO3\CMS\Install\Service\CoreVersionService::class, array('fetchVersionMatrixFromRemote'), array(), '', FALSE);
-               $registry = $this->getMock(\TYPO3\CMS\Core\Registry::class);
+               /** @var $instance CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
+               $instance = $this->getAccessibleMock(CoreVersionService::class, array('fetchVersionMatrixFromRemote'), array(), '', FALSE);
+               $registry = $this->getMock(Registry::class);
                $versionArray = array(
+                       '7' => array(),
                        '6.2' => array(),
-                       '6.1' => array(),
                );
                $registry
                        ->expects($this->once())
                        ->method('set')
-                       ->with('TYPO3.CMS.Install', 'coreVersionMatrix', $this->logicalNot($this->arrayHasKey('6.1')));
+                       ->with('TYPO3.CMS.Install', 'coreVersionMatrix', $this->logicalNot($this->arrayHasKey('6.2')));
                $instance->_set('registry', $registry);
                $instance->expects($this->once())->method('fetchVersionMatrixFromRemote')->will($this->returnValue($versionArray));
                $instance->updateVersionMatrix();
@@ -57,9 +60,9 @@ class CoreVersionServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function isInstalledVersionAReleasedVersionReturnsTrueForNonDevelopmentVersion() {
-               /** @var $instance \TYPO3\CMS\Install\Service\CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
-               $instance = $this->getAccessibleMock(\TYPO3\CMS\Install\Service\CoreVersionService::class, array('getInstalledVersion'), array(), '', FALSE);
-               $instance->expects($this->once())->method('getInstalledVersion')->will($this->returnValue('6.2.0'));
+               /** @var $instance CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
+               $instance = $this->getAccessibleMock(CoreVersionService::class, array('getInstalledVersion'), array(), '', FALSE);
+               $instance->expects($this->once())->method('getInstalledVersion')->will($this->returnValue('7.2.0'));
                $this->assertTrue($instance->isInstalledVersionAReleasedVersion());
        }
 
@@ -67,9 +70,9 @@ class CoreVersionServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function isInstalledVersionAReleasedVersionReturnsFalseForDevelopmentVersion() {
-               /** @var $instance \TYPO3\CMS\Install\Service\CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
-               $instance = $this->getAccessibleMock(\TYPO3\CMS\Install\Service\CoreVersionService::class, array('getInstalledVersion'), array(), '', FALSE);
-               $instance->expects($this->once())->method('getInstalledVersion')->will($this->returnValue('6.2-dev'));
+               /** @var $instance CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
+               $instance = $this->getAccessibleMock(CoreVersionService::class, array('getInstalledVersion'), array(), '', FALSE);
+               $instance->expects($this->once())->method('getInstalledVersion')->will($this->returnValue('7.4-dev'));
                $this->assertFalse($instance->isInstalledVersionAReleasedVersion());
        }
 
@@ -78,24 +81,24 @@ class CoreVersionServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @expectedException \TYPO3\CMS\Install\Service\Exception\CoreVersionServiceException
         */
        public function getTarGzSha1OfVersionThrowsExceptionIfSha1DoesNotExistInMatrix() {
-               /** @var $instance \TYPO3\CMS\Install\Service\CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
+               /** @var $instance CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
                $instance = $this->getAccessibleMock(
-                       \TYPO3\CMS\Install\Service\CoreVersionService::class,
-                       array('getVersionMatrix', 'getMinorVersion', 'ensureVersionExistsInMatrix'),
+                       CoreVersionService::class,
+                       array('getVersionMatrix', 'getMajorVersion', 'ensureVersionExistsInMatrix'),
                        array(),
                        '',
                        FALSE
                );
                $versionMatrix = array(
-                       '6.2' => array(
+                       '7' => array(
                                'releases' => array(
-                                       '6.2.42' => array(),
+                                       '7.2.0' => array(),
                                ),
                        ),
                );
-               $instance->expects($this->once())->method('getMinorVersion')->will($this->returnValue('6.2'));
+               $instance->expects($this->once())->method('getMajorVersion')->will($this->returnValue('7'));
                $instance->expects($this->any())->method('getVersionMatrix')->will($this->returnValue($versionMatrix));
-               $this->assertTrue($instance->getTarGzSha1OfVersion('6.2.42'));
+               $this->assertTrue($instance->getTarGzSha1OfVersion('7.2.0'));
        }
 
        /**
@@ -103,17 +106,17 @@ class CoreVersionServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function getTarGzSha1OfVersionReturnsSha1OfSpecifiedVersion() {
                $versionMatrixFixtureFile = __DIR__ . '/Fixtures/VersionMatrixFixture.php';
-               /** @var $instance \TYPO3\CMS\Install\Service\CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
+               /** @var $instance CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
                $instance = $this->getAccessibleMock(
-                       \TYPO3\CMS\Install\Service\CoreVersionService::class,
-                       array('getVersionMatrix', 'getMinorVersion', 'ensureVersionExistsInMatrix'),
+                       CoreVersionService::class,
+                       array('getVersionMatrix', 'getMajorVersion', 'ensureVersionExistsInMatrix'),
                        array(),
                        '',
                        FALSE
                );
-               $instance->expects($this->any())->method('getMinorVersion')->will($this->returnValue('6.2'));
+               $instance->expects($this->any())->method('getMajorVersion')->will($this->returnValue('7'));
                $instance->expects($this->any())->method('getVersionMatrix')->will($this->returnValue(require($versionMatrixFixtureFile)));
-               $this->assertSame('3dc156eed4b99577232f537d798a8691493f8a83', $instance->getTarGzSha1OfVersion('6.2.0alpha3'));
+               $this->assertSame('3dc156eed4b99577232f537d798a8691493f8a83', $instance->getTarGzSha1OfVersion('7.2.0'));
        }
 
        /**
@@ -122,22 +125,22 @@ class CoreVersionServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function isYoungerPatchReleaseAvailableReturnsTrueIfYoungerReleaseIsAvailable() {
-               /** @var $instance \TYPO3\CMS\Install\Service\CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
+               /** @var $instance CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
                $instance = $this->getAccessibleMock(
-                       \TYPO3\CMS\Install\Service\CoreVersionService::class,
+                       CoreVersionService::class,
                        array('getVersionMatrix', 'getInstalledVersion'),
                        array(),
                        '',
                        FALSE
                );
                $versionMatrix = array(
-                       '6.2' => array(
+                       '7' => array(
                                'releases' => array(
-                                       '6.2.42' => array(
-                                               'type' => 'regular',
+                                       '7.2.1' => array(
+                                               'type' => 'security',
                                                'date' => '2013-12-01 18:24:25 UTC',
                                        ),
-                                       '6.2.41' => array(
+                                       '7.2.0' => array(
                                                'type' => 'regular',
                                                'date' => '2013-11-01 18:24:25 UTC',
                                        ),
@@ -145,7 +148,7 @@ class CoreVersionServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        ),
                );
                $instance->expects($this->any())->method('getVersionMatrix')->will($this->returnValue($versionMatrix));
-               $instance->expects($this->any())->method('getInstalledVersion')->will($this->returnValue('6.2.41'));
+               $instance->expects($this->any())->method('getInstalledVersion')->will($this->returnValue('7.2.0'));
                $this->assertTrue($instance->isYoungerPatchReleaseAvailable());
        }
 
@@ -155,22 +158,22 @@ class CoreVersionServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function isYoungerReleaseAvailableReturnsFalseIfNoYoungerReleaseExists() {
-               /** @var $instance \TYPO3\CMS\Install\Service\CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
+               /** @var $instance CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
                $instance = $this->getAccessibleMock(
-                       \TYPO3\CMS\Install\Service\CoreVersionService::class,
+                       CoreVersionService::class,
                        array('getVersionMatrix', 'getInstalledVersion'),
                        array(),
                        '',
                        FALSE
                );
                $versionMatrix = array(
-                       '6.2' => array(
+                       '7' => array(
                                'releases' => array(
-                                       '6.2.42' => array(
+                                       '7.2.0' => array(
                                                'type' => 'regular',
                                                'date' => '2013-12-01 18:24:25 UTC',
                                        ),
-                                       '6.2.41' => array(
+                                       '7.1.0' => array(
                                                'type' => 'regular',
                                                'date' => '2013-11-01 18:24:25 UTC',
                                        ),
@@ -178,7 +181,7 @@ class CoreVersionServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        ),
                );
                $instance->expects($this->any())->method('getVersionMatrix')->will($this->returnValue($versionMatrix));
-               $instance->expects($this->any())->method('getInstalledVersion')->will($this->returnValue('6.2.42'));
+               $instance->expects($this->any())->method('getInstalledVersion')->will($this->returnValue('7.2.0'));
                $this->assertFalse($instance->isYoungerPatchReleaseAvailable());
        }
 
@@ -188,22 +191,22 @@ class CoreVersionServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function isYoungerReleaseAvailableReturnsFalseIfOnlyADevelopmentReleaseIsYounger() {
-               /** @var $instance \TYPO3\CMS\Install\Service\CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
+               /** @var $instance CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
                $instance = $this->getAccessibleMock(
-                       \TYPO3\CMS\Install\Service\CoreVersionService::class,
+                       CoreVersionService::class,
                        array('getVersionMatrix', 'getInstalledVersion'),
                        array(),
                        '',
                        FALSE
                );
                $versionMatrix = array(
-                       '6.2' => array(
+                       '7' => array(
                                'releases' => array(
-                                       '6.2.42' => array(
+                                       '7.3.0' => array(
                                                'type' => 'development',
                                                'date' => '2013-12-01 18:24:25 UTC',
                                        ),
-                                       '6.2.41' => array(
+                                       '7.2.0' => array(
                                                'type' => 'regular',
                                                'date' => '2013-11-01 18:24:25 UTC',
                                        ),
@@ -211,7 +214,7 @@ class CoreVersionServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        ),
                );
                $instance->expects($this->any())->method('getVersionMatrix')->will($this->returnValue($versionMatrix));
-               $instance->expects($this->any())->method('getInstalledVersion')->will($this->returnValue('6.2.41'));
+               $instance->expects($this->any())->method('getInstalledVersion')->will($this->returnValue('7.2.0'));
                $this->assertFalse($instance->isYoungerPatchReleaseAvailable());
        }
 
@@ -221,22 +224,22 @@ class CoreVersionServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function isYoungerDevelopmentReleaseAvailableReturnsTrueIfADevelopmentReleaseIsYounger() {
-               /** @var $instance \TYPO3\CMS\Install\Service\CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
+               /** @var $instance CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
                $instance = $this->getAccessibleMock(
-                       \TYPO3\CMS\Install\Service\CoreVersionService::class,
+                       CoreVersionService::class,
                        array('getVersionMatrix', 'getInstalledVersion'),
                        array(),
                        '',
                        FALSE
                );
                $versionMatrix = array(
-                       '6.2' => array(
+                       '7' => array(
                                'releases' => array(
-                                       '6.2.42' => array(
+                                       '7.3.0' => array(
                                                'type' => 'development',
                                                'date' => '2013-12-01 18:24:25 UTC',
                                        ),
-                                       '6.2.41' => array(
+                                       '7.2.0' => array(
                                                'type' => 'regular',
                                                'date' => '2013-11-01 18:24:25 UTC',
                                        ),
@@ -244,7 +247,7 @@ class CoreVersionServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        ),
                );
                $instance->expects($this->any())->method('getVersionMatrix')->will($this->returnValue($versionMatrix));
-               $instance->expects($this->any())->method('getInstalledVersion')->will($this->returnValue('6.2.41'));
+               $instance->expects($this->any())->method('getInstalledVersion')->will($this->returnValue('7.2.0'));
                $this->assertTrue($instance->isYoungerPatchDevelopmentReleaseAvailable());
        }
 
@@ -254,22 +257,22 @@ class CoreVersionServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function isUpdateSecurityRelevantReturnsTrueIfAnUpdateIsSecurityRelevant() {
-               /** @var $instance \TYPO3\CMS\Install\Service\CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
+               /** @var $instance CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
                $instance = $this->getAccessibleMock(
-                       \TYPO3\CMS\Install\Service\CoreVersionService::class,
+                       CoreVersionService::class,
                        array('getVersionMatrix', 'getInstalledVersion'),
                        array(),
                        '',
                        FALSE
                );
                $versionMatrix = array(
-                       '6.2' => array(
+                       '7' => array(
                                'releases' => array(
-                                       '6.2.42' => array(
+                                       '7.3.0' => array(
                                                'type' => 'security',
                                                'date' => '2013-12-01 18:24:25 UTC',
                                        ),
-                                       '6.2.41' => array(
+                                       '7.2.0' => array(
                                                'type' => 'regular',
                                                'date' => '2013-11-01 18:24:25 UTC',
                                        ),
@@ -277,7 +280,7 @@ class CoreVersionServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        ),
                );
                $instance->expects($this->any())->method('getVersionMatrix')->will($this->returnValue($versionMatrix));
-               $instance->expects($this->any())->method('getInstalledVersion')->will($this->returnValue('6.2.41'));
+               $instance->expects($this->any())->method('getInstalledVersion')->will($this->returnValue('7.2.0'));
                $this->assertTrue($instance->isUpdateSecurityRelevant());
        }
 
@@ -287,22 +290,22 @@ class CoreVersionServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function isUpdateSecurityRelevantReturnsFalseIfUpdateIsNotSecurityRelevant() {
-               /** @var $instance \TYPO3\CMS\Install\Service\CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
+               /** @var $instance CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
                $instance = $this->getAccessibleMock(
-                       \TYPO3\CMS\Install\Service\CoreVersionService::class,
+                       CoreVersionService::class,
                        array('getVersionMatrix', 'getInstalledVersion'),
                        array(),
                        '',
                        FALSE
                );
                $versionMatrix = array(
-                       '6.2' => array(
+                       '7' => array(
                                'releases' => array(
-                                       '6.2.42' => array(
+                                       '7.3.0' => array(
                                                'type' => 'regular',
                                                'date' => '2013-12-01 18:24:25 UTC',
                                        ),
-                                       '6.2.41' => array(
+                                       '7.2.0' => array(
                                                'type' => 'regular',
                                                'date' => '2013-11-01 18:24:25 UTC',
                                        ),
@@ -310,52 +313,51 @@ class CoreVersionServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        ),
                );
                $instance->expects($this->any())->method('getVersionMatrix')->will($this->returnValue($versionMatrix));
-               $instance->expects($this->any())->method('getInstalledVersion')->will($this->returnValue('6.2.41'));
+               $instance->expects($this->any())->method('getInstalledVersion')->will($this->returnValue('7.2.0'));
                $this->assertFalse($instance->isUpdateSecurityRelevant());
        }
 
        /**
         * @test
         */
-       public function getInstalledMinorVersionFetchesInstalledVersionNumber() {
-               /** @var $instance \TYPO3\CMS\Install\Service\CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
-               $instance = $this->getAccessibleMock(\TYPO3\CMS\Install\Service\CoreVersionService::class, array('getInstalledVersion'), array(), '', FALSE);
-               $instance->expects($this->once())->method('getInstalledVersion')->will($this->returnValue('6.2.0'));
-               $this->assertSame('6.2', $instance->_call('getInstalledMinorVersion'));
+       public function getInstalledMajorVersionFetchesInstalledVersionNumber() {
+               /** @var $instance CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
+               $instance = $this->getAccessibleMock(CoreVersionService::class, array('getInstalledVersion'), array(), '', FALSE);
+               $instance->expects($this->once())->method('getInstalledVersion')->will($this->returnValue('7.2.0'));
+               $this->assertSame('7', $instance->_call('getInstalledMajorVersion'));
        }
 
        /**
         * Data provider
         */
-       public function getMinorVersionDataProvider() {
+       public function getMajorVersionDataProvider() {
                return array(
-                       '6.2.0' => array(
-                               '6.2.0',
-                               '6.2',
-                       ),
-                       '6.2-dev' => array(
-                               '6.2-dev',
-                               '6.2',
+                       '7.2' => array(
+                               '7.2.0',
+                               '7',
                        ),
-                       '6.2.0alpha2' => array(
-                               '6.2.0alpha2',
-                               '6.2',
+                       '7.4-dev' => array(
+                               '7.4-dev',
+                               '7',
                        ),
-                       '4.5.25' => array(
-                               '4.5.25',
-                               '4.5',
+                       '4.5' => array(
+                               '4.5.40',
+                               '4',
                        ),
                );
        }
 
        /**
         * @test
-        * @dataProvider getMinorVersionDataProvider
+        * @dataProvider getMajorVersionDataProvider
+        * @param string $version
+        * @param string $expectedMajor
+        * @throws \InvalidArgumentException
         */
-       public function getMinorVersionReturnsCorrectMinorVersion($version, $expectedMajor) {
-               /** @var $instance \TYPO3\CMS\Install\Service\CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
-               $instance = $this->getAccessibleMock(\TYPO3\CMS\Install\Service\CoreVersionService::class, array('dummy'), array(), '', FALSE);
-               $this->assertSame($expectedMajor, $instance->_call('getMinorVersion', $version));
+       public function getMajorVersionReturnsCorrectMajorVersion($version, $expectedMajor) {
+               /** @var $instance CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
+               $instance = $this->getAccessibleMock(CoreVersionService::class, array('dummy'), array(), '', FALSE);
+               $this->assertSame($expectedMajor, $instance->_call('getMajorVersion', $version));
        }
 
        /**
@@ -363,9 +365,9 @@ class CoreVersionServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @expectedException \TYPO3\CMS\Install\Service\Exception\CoreVersionServiceException
         */
        public function getVersionMatrixThrowsExceptionIfVersionMatrixIsNotYetSetInRegistry() {
-               /** @var $instance \TYPO3\CMS\Install\Service\CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
-               $instance = $this->getAccessibleMock(\TYPO3\CMS\Install\Service\CoreVersionService::class, array('fetchVersionMatrixFromRemote'), array(), '', FALSE);
-               $registry = $this->getMock(\TYPO3\CMS\Core\Registry::class);
+               /** @var $instance CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
+               $instance = $this->getAccessibleMock(CoreVersionService::class, array('fetchVersionMatrixFromRemote'), array(), '', FALSE);
+               $registry = $this->getMock(Registry::class);
                $registry->expects($this->once())->method('get')->will($this->returnValue(NULL));
                $instance->_set('registry', $registry);
                $instance->_call('getVersionMatrix');
@@ -375,9 +377,9 @@ class CoreVersionServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function getVersionMatrixReturnsMatrixFromRegistry() {
-               /** @var $instance \TYPO3\CMS\Install\Service\CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
-               $instance = $this->getAccessibleMock(\TYPO3\CMS\Install\Service\CoreVersionService::class, array('fetchVersionMatrixFromRemote'), array(), '', FALSE);
-               $registry = $this->getMock(\TYPO3\CMS\Core\Registry::class);
+               /** @var $instance CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
+               $instance = $this->getAccessibleMock(CoreVersionService::class, array('fetchVersionMatrixFromRemote'), array(), '', FALSE);
+               $registry = $this->getMock(Registry::class);
                $versionArray = array($this->getUniqueId());
                $registry->expects($this->once())->method('get')->will($this->returnValue($versionArray));
                $instance->_set('registry', $registry);
@@ -390,23 +392,23 @@ class CoreVersionServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function getReleaseTimestampOfVersionThrowsExceptionIfReleaseDateIsNotDefined() {
                $versionMatrix = array(
-                       '6.2' => array(
+                       '7' => array(
                                'releases' => array(
-                                       '6.2.42' => array()
+                                       '7.2.0' => array()
                                ),
                        ),
                );
-               /** @var $instance \TYPO3\CMS\Install\Service\CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
+               /** @var $instance CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
                $instance = $this->getAccessibleMock(
-                       \TYPO3\CMS\Install\Service\CoreVersionService::class,
-                       array('getVersionMatrix', 'getMinorVersion', 'ensureVersionExistsInMatrix'),
+                       CoreVersionService::class,
+                       array('getVersionMatrix', 'getMajorVersion', 'ensureVersionExistsInMatrix'),
                        array(),
                        '',
                        FALSE
                );
-               $instance->expects($this->once())->method('getMinorVersion')->will($this->returnValue('6.2'));
+               $instance->expects($this->once())->method('getMajorVersion')->will($this->returnValue('7'));
                $instance->expects($this->once())->method('getVersionMatrix')->will($this->returnValue($versionMatrix));
-               $instance->_call('getReleaseTimestampOfVersion', '6.2.42');
+               $instance->_call('getReleaseTimestampOfVersion', '7.2.0');
        }
 
        /**
@@ -414,17 +416,17 @@ class CoreVersionServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function getReleaseTimestampOfVersionReturnsTimestamp() {
                $versionMatrixFixtureFile = __DIR__ . '/Fixtures/VersionMatrixFixture.php';
-               /** @var $instance \TYPO3\CMS\Install\Service\CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
+               /** @var $instance CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
                $instance = $this->getAccessibleMock(
-                       \TYPO3\CMS\Install\Service\CoreVersionService::class,
-                       array('getVersionMatrix', 'getMinorVersion', 'ensureVersionExistsInMatrix'),
+                       CoreVersionService::class,
+                       array('getVersionMatrix', 'getMajorVersion', 'ensureVersionExistsInMatrix'),
                        array(),
                        '',
                        FALSE
                );
-               $instance->expects($this->once())->method('getMinorVersion')->will($this->returnValue('6.2'));
+               $instance->expects($this->once())->method('getMajorVersion')->will($this->returnValue('7'));
                $instance->expects($this->once())->method('getVersionMatrix')->will($this->returnValue(require($versionMatrixFixtureFile)));
-               $this->assertSame(1380651865, $instance->_call('getReleaseTimestampOfVersion', '6.2.0alpha3'));
+               $this->assertSame(1398968665, $instance->_call('getReleaseTimestampOfVersion', '7.3.1'));
        }
 
        /**
@@ -433,15 +435,15 @@ class CoreVersionServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function ensureVersionExistsInMatrixThrowsExceptionIfMinorVersionDoesNotExist() {
                $versionMatrixFixtureFile = __DIR__ . '/Fixtures/VersionMatrixFixture.php';
-               /** @var $instance \TYPO3\CMS\Install\Service\CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
+               /** @var $instance CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
                $instance = $this->getAccessibleMock(
-                       \TYPO3\CMS\Install\Service\CoreVersionService::class,
-                       array('getVersionMatrix', 'getMinorVersion'),
+                       CoreVersionService::class,
+                       array('getVersionMatrix', 'getMajorVersion'),
                        array(),
                        '',
                        FALSE
                );
-               $instance->expects($this->once())->method('getMinorVersion')->will($this->returnValue('2.0'));
+               $instance->expects($this->once())->method('getMajorVersion')->will($this->returnValue('2'));
                $instance->expects($this->once())->method('getVersionMatrix')->will($this->returnValue(require($versionMatrixFixtureFile)));
                $instance->_call('ensureVersionExistsInMatrix', '2.0.42');
        }
@@ -452,17 +454,17 @@ class CoreVersionServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function ensureVersionExistsInMatrixThrowsExceptionIfPatchLevelDoesNotExist() {
                $versionMatrixFixtureFile = __DIR__ . '/Fixtures/VersionMatrixFixture.php';
-               /** @var $instance \TYPO3\CMS\Install\Service\CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
+               /** @var $instance CoreVersionService|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
                $instance = $this->getAccessibleMock(
-                       \TYPO3\CMS\Install\Service\CoreVersionService::class,
-                       array('getVersionMatrix', 'getMinorVersion'),
+                       CoreVersionService::class,
+                       array('getVersionMatrix', 'getMajorVersion'),
                        array(),
                        '',
                        FALSE
                );
-               $instance->expects($this->once())->method('getMinorVersion')->will($this->returnValue('6.2'));
+               $instance->expects($this->once())->method('getMajorVersion')->will($this->returnValue('7'));
                $instance->expects($this->once())->method('getVersionMatrix')->will($this->returnValue(require($versionMatrixFixtureFile)));
-               $instance->_call('ensureVersionExistsInMatrix', '6.2.5');
+               $instance->_call('ensureVersionExistsInMatrix', '7.2.5');
        }
 
 }
index ef3a7fc..27c9f65 100644 (file)
@@ -1,43 +1,22 @@
 <?php
 return array(
-       '6.2' => array(
+       '7' => array(
                'releases' => array(
-                       '6.2-snapshot-20131004' => array(
+                       '7.4-dev' => array(
                                'type' => 'development',
                                'date' => '2014-06-01 18:24:25 UTC',
                        ),
-                       '6.2.3' => array(
+                       '7.3.1' => array(
                                'type' => 'regular',
                                'date' => '2014-05-01 18:24:25 UTC',
                        ),
-                       '6.2.2' => array(
+                       '7.3.0' => array(
                                'type' => 'security',
                                'date' => '2014-04-01 18:24:25 UTC',
                        ),
-                       '6.2.1' => array(
+                       '7.2.0' => array(
                                'type' => 'regular',
                                'date' => '2014-03-01 18:24:25 UTC',
-                       ),
-                       '6.2.0' => array(
-                               'type' => 'release',
-                               'date' => '2014-02-01 18:24:25 UTC',
-                       ),
-                       '6.2.0rc1' => array(
-                               'type' => 'development',
-                               'date' => '2014-01-01 18:24:25 UTC',
-                       ),
-                       '6.2.0beta2' => array(
-                               'type' => 'development',
-                               'date' => '2013-12-01 18:24:25 UTC',
-                       ),
-                       '6.2.0beta1' => array(
-                               'type' => 'development',
-                               'date' => '2013-11-01 18:24:25 UTC',
-                       ),
-                       '6.2.0alpha3' => array(
-                               'version' => '6.2.0alpha3',
-                               'date' => '2013-10-01 18:24:25 UTC',
-                               'type' => 'development',
                                'checksums' => array(
                                        'tar' => array(
                                                'md5' => 'e91acf53bb03cb943bd27e76643901c5',
@@ -49,51 +28,13 @@ return array(
                                        ),
                                ),
                                'url' => array(
-                                       'zip' => 'http://get.typo3.org/6.2.0alpha3/zip',
-                                       'tar' => 'http://get.typo3.org/6.2.0alpha3',
-                               ),
-                       ),
-                       '6.2.0alpha2' => array(
-                               'version' => '6.2.0alpha2',
-                               'date' => '2013-07-11 13:34:39 UTC',
-                               'type' => 'development',
-                               'checksums' => array(
-                                       'tar' => array(
-                                               'md5' => 'd528f7abe0290bfb4302b7ef7b64a2fe',
-                                               'sha1' => 'bf50ae8180604a8232fba3f70380da650b3266a1',
-                                       ),
-                                       'zip' => array(
-                                               'md5' => 'd71b97d09cb1719b76ba3bd86efaba19',
-                                               'sha1' => '73a6d9478fef4a9949931152bcecc82caa0cc0c8',
-                                       ),
-                               ),
-                               'url' => array(
-                                       'zip' => 'http://get.typo3.org/6.2.0alpha2/zip',
-                                       'tar' => 'http://get.typo3.org/6.2.0alpha2',
-                               ),
-                       ),
-                       '6.2.0alpha1' => array(
-                               'version' => '6.2.0alpha1',
-                               'date' => '2013-06-04 21:01:54 UTC',
-                               'type' => 'development',
-                               'checksums' => array(
-                                       'tar' => array(
-                                               'md5' => '74459680910c4982b3368a9b8e6b6aa7',
-                                               'sha1' => '6989d344fbaa6cdc4f0cf87684403f795fe5a97f',
-                                       ),
-                                       'zip' => array(
-                                               'md5' => '6cd76c5885f0e001599ae6c621cc0614',
-                                               'sha1' => '60576909d38084bcba4360bdc0f734540725f615',
-                                       ),
-                               ),
-                               'url' => array(
-                                       'zip' => 'http://get.typo3.org/6.2.0alpha1/zip',
-                                       'tar' => 'http://get.typo3.org/6.2.0alpha1',
+                                       'zip' => 'http://get.typo3.org/7.2/zip',
+                                       'tar' => 'http://get.typo3.org/7.2',
                                ),
                        ),
                ),
-               'latest' => '6.2.3',
-               'stable' => '6.2.3',
+               'latest' => '7.3.1',
+               'stable' => '7.3.1',
                'active' => TRUE,
        ),
 );