Commit 52c68d46 authored by Thomas Löffler's avatar Thomas Löffler

Merge branch 'develop' into task/update-to-v9

parents 0ba8ea4a 85af25fd
Pipeline #7814 passed with stages
in 4 minutes and 41 seconds
#ddev-generated: Automatically generated ddev .gitignore.
# You can remove the above line if you want to edit and maintain this file yourself.
/commands/*/*.example
/commands/*/README.txt
/commands/db/mysql
/homeadditions/*.example
/homeadditions/README.txt
/import.yaml
/docker-compose.yaml
/db_snapshots
......@@ -8,6 +13,10 @@
/import-db
/.bgsync*
/config.*.y*ml
/.webimageBuild
/.dbimageBuild
/.bgsyncimageBuild
/.sshimageBuild
/.webimageExtra
/.dbimageExtra
/*-build/Dockerfile.example
APIVersion: v1.9.1
APIVersion: v1.11.2
name: ter
type: typo3
docroot: public
......@@ -25,11 +25,11 @@ use_dns_when_possible: true
timezone: Europe/Berlin
# This config.yaml was created with ddev version v1.9.1
# webimage: drud/ddev-webserver:v1.9.0
# dbimage: drud/ddev-dbserver:v1.9.0-10.2
# dbaimage: drud/phpmyadmin:v1.9.0
# bgsyncimage: drud/ddev-bgsync:v1.9.0
# This config.yaml was created with ddev version v1.11.2
# webimage: drud/ddev-webserver:v1.11.0
# dbimage: drud/ddev-dbserver:v1.11.0-10.2
# dbaimage: drud/phpmyadmin:v1.11.0
# bgsyncimage: drud/ddev-bgsync:v1.11.0
# However we do not recommend explicitly wiring these images into the
# config.yaml as they may break future versions of ddev.
# You can update this config.yaml using 'ddev config'.
......@@ -43,7 +43,7 @@ timezone: Europe/Berlin
# docroot: <relative_path> # Relative path to the directory containing index.php.
# php_version: "7.1" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3"
# php_version: "7.2" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4"
# You can explicitly specify the webimage, dbimage, dbaimage lines but this
# is not recommended, as the images are often closely tied to ddev's' behavior,
......@@ -58,9 +58,18 @@ timezone: Europe/Berlin
# router_https_port: <port> # Port for https (defaults to 443)
# xdebug_enabled: false # Set to true to enable xdebug and "ddev start" or "ddev restart"
# Note that for most people the commands
# "ddev exec enable_xdebug" and "ddev exec disable_xdebug" work better,
# as leaving xdebug enabled all the time is a big performance hit.
# webserver_type: nginx-fpm # Can be set to apache-fpm or apache-cgi as well
# timezone: Europe/Berlin
# This is the timezone used in the containers and by PHP;
# it can be set to any valid timezone,
# see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
# For example Europe/Dublin or MST7MDT
# additional_hostnames:
# - somename
# - someothername
......@@ -121,11 +130,9 @@ timezone: Europe/Berlin
# webimage_extra_packages: [php-yaml, php7.3-ldap]
# Extra Debian packages that are needed in the webimage can be added here
# This is ignored if a free-form .ddev/web-build/Dockerfile is provided
# dbimage_extra_packages: [telnet,netcat]
# Extra Debian packages that are needed in the dbimage can be added here
# This is ignored if a free-form .ddev/db-build/Dockerfile is provided
# use_dns_when_possible: true
# If the host has internet access and the domain configured can
......@@ -136,9 +143,10 @@ timezone: Europe/Berlin
# project_tld: ddev.site
# The top-level domain used for project URLs
# The default "ddev.site" allows DNS lookup via a wildcard
# For backward compatibility this can be changed to "ddev.local"
# If you prefer you can change this to "ddev.local" to preserve
# pre-v1.9 behavior.
# ngrok_args: --subdomain mysite --auth "user:pass"
# ngrok_args: --subdomain mysite --auth username:pass
# Provide extra flags to the "ngrok http" command, see
# https://ngrok.com/docs#http or run "ngrok http -h"
......@@ -152,4 +160,4 @@ timezone: Europe/Berlin
# for them. Example:
#hooks:
# post-start:
# - exec: composer install -d /var/www/html
\ No newline at end of file
# - exec: composer install -d /var/www/html
......@@ -3,6 +3,4 @@ version: '3.6'
services:
web:
environment:
- TYPO3_CONTEXT=Development
- PHP_IDE_CONFIG="serverName=ter.ddev.local"
- DEBIAN_FRONTEND=noninteractive
\ No newline at end of file
- TYPO3_CONTEXT=Development
\ No newline at end of file
This diff is collapsed.
......@@ -142,7 +142,7 @@ class tx_ter_helper
if ($row = $this->getDatabaseConnection()->sql_fetch_assoc($res)) {
if (!$this->userIsAlreadyLoggedIn(
$accountData
) && !$this->ldapValidationSucceeded($accountData)
) && !$this->ldapValidationSucceeded($accountData)
) {
throw new \T3o\Ter\Exception\UnauthorizedException('Wrong password.', TX_TER_ERROR_GENERAL_WRONGPASSWORD);
}
......@@ -362,7 +362,7 @@ class tx_ter_helper
// Check if update of files requested
$updateRequestedFile = $this->pluginObj->repositoryDir . 'extensions.xml.gz.needsupdate';
if (@filemtime($updateRequestedFile) <= @filemtime($this->pluginObj->repositoryDir . 'extensions.xml.gz')) {
if (file_exists($updateRequestedFile) && @filemtime($updateRequestedFile) <= @filemtime($this->pluginObj->repositoryDir . 'extensions.xml.gz')) {
return;
}
......@@ -401,6 +401,7 @@ class tx_ter_helper
$dom = new DOMDocument('1.0', 'utf-8');
$dom->formatOutput = true;
$extensionsObj = $dom->appendChild(new DOMElement('extensions'));
$documentationService = GeneralUtility::makeInstance(\T3o\TerFe2\Service\DocumentationService::class);
// Create the nested XML structure:
foreach ($extensionsAndVersionsArr as $extensionKey => $extensionVersionsArr) {
......@@ -412,6 +413,16 @@ class tx_ter_helper
$this->xmlentities($extensionsTotalDownloadsArr[$extensionKey])
)
);
$extensionRecord = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\ConnectionPool::class)
->getConnectionForTable('tx_terfe2_domain_model_extension')
->select(
['uid', 'external_manual'],
'tx_terfe2_domain_model_extension',
[
'ext_key' => $extensionKey
]
)
->fetch();
foreach ($extensionVersionsArr['versions'] as $versionNumber => $extensionVersionArr) {
$versionObj = $extensionObj->appendChild(new DOMElement('version'));
......@@ -463,6 +474,12 @@ class tx_ter_helper
)
);
$versionObj->appendChild(new DOMElement('t3xfilemd5', $extensionVersionArr['t3xfilemd5']));
$documentationLink = '';
try {
$documentationLink = $documentationService->getDocumentationLink($extensionKey, $versionNumber, true);
} catch (Exception $e) {
}
$versionObj->appendChild(new DOMElement('documentation_link', $extensionRecord['external_manual'] ?: $documentationLink));
}
}
......
......@@ -615,4 +615,14 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{
$this->notifications = $notifications;
}
public function getMatrixOfSupportedTypo3Versions(): array
{
$supportedTypo3Versions = [];
foreach ($this->versions as $version) {
$version->getMatrixOfSupportedTypo3Versions($supportedTypo3Versions);
}
return $supportedTypo3Versions;
}
}
......@@ -21,6 +21,8 @@ use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
*/
class Version extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{
const VERSION_IS_INSECURE = -1;
const VERSION_IS_OUTDATED = -2;
/**
* Title of the extension
......@@ -1134,7 +1136,7 @@ class Version extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
}
/**
* @return \T3o\TerFe2\Domain\Model\Relation
* @return \T3o\TerFe2\Domain\Model\Relation|null
*/
public function getTypo3Dependency()
{
......@@ -1151,31 +1153,59 @@ class Version extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
}
/**
* @param array $supportedTypo3Versions
* @return array
*/
public function getMatrixOfSupportedTypo3Versions(): array
public function getMatrixOfSupportedTypo3Versions(array $supportedTypo3Versions = []): array
{
// @todo: Get these versions automatically
$typo3Versions = [
'7 LTS' => 7006000,
'8 LTS' => 8007000,
'9 LTS' => 9005000
];
$supportedTypo3Versions = [];
$ltsVersionService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\T3o\TerFe2\Service\LTSVersionService::class);
$oldLTSVersions = $ltsVersionService->getOldLTSVersions();
$this->getSupportedTypo3Versions($supportedTypo3Versions, $oldLTSVersions, 'warning');
foreach ($typo3Versions as $label => $mainVersion) {
$supportedTypo3Versions[$label] = \T3o\TerFe2\Utility\VersionUtility::doesExtensionSupportTypo3Version($this->getExtension(), $mainVersion);
$currentStableVersions = $ltsVersionService->getCurrentStableVersions(true);
$this->getSupportedTypo3Versions($supportedTypo3Versions, $currentStableVersions, 'success');
if ($this->doesSupportTypo3Version($ltsVersionService->getLatestDevelopmentVersion(true))) {
$supportedTypo3Versions[$ltsVersionService->getVersionLabelOfRelease($ltsVersionService->getLatestDevelopmentVersion(true))] = [
'label' => $ltsVersionService->getVersionLabelOfRelease($ltsVersionService->getLatestDevelopmentVersion(true)) . '-dev',
'badgeClass' => 'info'
];
}
return $supportedTypo3Versions;
}
/**
* @return bool
*/
public function hasTypo3Dependency()
public function doesSupportTypo3Version(int $versionNumber): bool
{
return $this->getTypo3Dependency() !== null;
if ($this->getTypo3Dependency() === null || $this->getReviewState() === \T3o\TerFe2\Domain\Model\Version::VERSION_IS_INSECURE) {
return false;
}
// reset from e.g. 7.6.21 to 7.6.0 for valid check
$resetMinimumVersion = (int)($this->getTypo3Dependency()->getMinimumVersion() / \T3o\TerFe2\Service\LTSVersionService::FACTOR_MINOR_VERSION) * \T3o\TerFe2\Service\LTSVersionService::FACTOR_MINOR_VERSION;
$supportsTypo3Version = $resetMinimumVersion <= $versionNumber && $this->getTypo3Dependency()->getMaximumVersion() >= $versionNumber;
if ($supportsTypo3Version) {
return true;
}
return false;
}
private function getSupportedTypo3Versions(array &$supportedTypo3Versions, array $versions, string $badgeClass)
{
$ltsVersionService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\T3o\TerFe2\Service\LTSVersionService::class);
foreach ($versions as $versionNumber) {
$mainVersion = floor($versionNumber / $ltsVersionService::FACTOR_MINOR_VERSION * $ltsVersionService::FACTOR_MINOR_VERSION);
$label = $ltsVersionService->getVersionLabelOfRelease($versionNumber) . ' LTS';
if ($this->doesSupportTypo3Version($mainVersion)) {
$supportedTypo3Versions[$ltsVersionService->getVersionLabelOfRelease($versionNumber)] = [
'label' => $label,
'badgeClass' => $badgeClass
];
}
}
}
/**
......
......@@ -64,10 +64,14 @@ class DocumentationService implements \TYPO3\CMS\Core\SingletonInterface
$documentationLink = '';
$oldManualsInformation = json_decode(@file_get_contents(PATH_site . $GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'] . 'oldmanuals.json'), true);
if (isset($this->docsInformation[$extensionKey]['docs'][$versionString])) {
// link to extension to get the latest manual
$url = $this->docsInformation[$extensionKey]['docs'][$versionString]['url'];
} elseif (isset($oldManualsInformation[$extensionKey])) {
foreach ($this->getPossibleVersionStrings($versionString) as $possibleVersionString) {
if (isset($this->docsInformation[$extensionKey]['docs'][$possibleVersionString])) {
$url = $this->docsInformation[$extensionKey]['docs'][$possibleVersionString]['url'];
break;
}
}
if ($url === '' && isset($oldManualsInformation[$extensionKey])) {
$baseUrl = 'https://docs.typo3.org/typo3cms/extensions/';
$url = $baseUrl . $extensionKey . '/';
}
......@@ -78,4 +82,21 @@ class DocumentationService implements \TYPO3\CMS\Core\SingletonInterface
return $returnUrlOnly ? $url : $documentationLink;
}
private function getPossibleVersionStrings(string $defaultVersion): array
{
$possibleVersionStrings = [
$defaultVersion,
// just 2 points without v
];
$versionParts = explode('.', $defaultVersion);
if (count($versionParts) === 3) {
$possibleVersionStrings[] = implode('.', array_slice($versionParts, 0, 2));
}
$possibleVersionStrings[] = ltrim($defaultVersion, 'v');
$possibleVersionStrings[] = ltrim(implode('.', array_slice($versionParts, 0, 2)), 'v');
return $possibleVersionStrings;
}
}
......@@ -21,11 +21,20 @@ use TYPO3\CMS\Core\Utility\VersionNumberUtility;
*/
class LTSVersionService
{
const FACTOR_MAIN_VERSION = 1000000;
const FACTOR_MINOR_VERSION = 1000;
const FIRST_LTS_VERSION_WITH_MAIN_VERSION_NUMBER = 7;
/**
* @var array
*/
public $coreData = '';
public $ltsVersionsWithMinorVersions = [
'4.5',
'6.2'
];
public function __construct()
{
// Will be automatically update with UpdateCurrentVersionListTask see T3o\Ter\Task\UpdateCurrentVersionListTask
......@@ -37,28 +46,72 @@ class LTSVersionService
/**
* Get the current stable versions
*
* @param bool $fullVersionNumber
* @return array
*/
public function getCurrentStableVersions()
public function getCurrentStableVersions($fullVersionNumber = false): array
{
return [
$this->getLatestOldLTS(),
$this->getLatestLTS()
$this->getLatestOldLTS($fullVersionNumber),
$this->getLatestLTS($fullVersionNumber)
];
}
/**
* Returns all maintained versions.
*
* @param bool $fullVersionNumber
* @return array
*/
public function getAllMaintainedVersions()
public function getAllMaintainedVersions($fullVersionNumber = false): array
{
$versions = $this->getCurrentStableVersions();
array_push($versions, $this->getLatestDevelopmentVersion());
$versions = $this->getCurrentStableVersions($fullVersionNumber);
array_push($versions, $this->getLatestDevelopmentVersion($fullVersionNumber));
return $versions;
}
/**
* Get all LTS versions ever
*
* @return array
*/
public function getAllLTSVersions(): array
{
$ltsVersions = [];
foreach ($this->coreData as $releaseVersion => $releaseData) {
if (in_array($releaseVersion, $this->ltsVersionsWithMinorVersions) || $releaseVersion >= self::FIRST_LTS_VERSION_WITH_MAIN_VERSION_NUMBER) {
$latestVersionParts = explode('.', $releaseData['latest']);
if ((int)$latestVersionParts[1] === 0) {
continue;
}
$minimumVersion = $latestVersionParts[0] . '.' . $latestVersionParts[1] . '.0';
$ltsVersions[] = VersionNumberUtility::convertVersionNumberToInteger($minimumVersion);
}
}
sort($ltsVersions);
return $ltsVersions;
}
/**
* Get all LTS versions but current maintained
*
* @return array
*/
public function getOldLTSVersions(): array
{
$oldLTSVersions = $this->getAllLTSVersions();
foreach ($oldLTSVersions as $key => $version) {
$mainVersion = floor($version / self::FACTOR_MAIN_VERSION);
if (in_array($mainVersion, $this->getCurrentStableVersions())) {
unset($oldLTSVersions[$key]);
}
}
return $oldLTSVersions;
}
/**
* Get latest version within a specific release
*
......@@ -78,30 +131,57 @@ class LTSVersionService
/**
* Get latest development version
*
* @return string
* @param bool $fullVersionNumber
* @return int
*/
public function getLatestDevelopmentVersion()
public function getLatestDevelopmentVersion($fullVersionNumber = false): int
{
return substr($this->coreData['latest_stable'], 0, 3);
if ($fullVersionNumber) {
return VersionNumberUtility::convertVersionNumberToInteger($this->coreData['latest_stable']);
}
return floor(VersionNumberUtility::convertVersionNumberToInteger($this->coreData['latest_stable']) / self::FACTOR_MAIN_VERSION);
}
public function getVersionLabelOfRelease(int $release): string
{
if ($release >= (self::FIRST_LTS_VERSION_WITH_MAIN_VERSION_NUMBER * self::FACTOR_MAIN_VERSION)) {
$versionLabel = (string)floor($release / self::FACTOR_MAIN_VERSION);
} else {
$fullVersionLabelParts = explode('.', VersionNumberUtility::convertIntegerToVersionNumber($release));
$versionLabel = $fullVersionLabelParts[0] . '.' . $fullVersionLabelParts[1];
}
return $versionLabel;
}
/**
* Get latest LTS Version
*
* @param bool $fullVersionNumber
* @return int
*/
private function getLatestLTS()
public function getLatestLTS($fullVersionNumber = false): int
{
return (int)substr($this->coreData['latest_lts'], 0, 1);
if ($fullVersionNumber) {
return VersionNumberUtility::convertVersionNumberToInteger($this->coreData['latest_lts']);
}
return floor(VersionNumberUtility::convertVersionNumberToInteger($this->coreData['latest_lts']) / self::FACTOR_MAIN_VERSION);
}
/**
* Get latest "old" LTS Version
*
* @param bool $fullVersionNumber
* @return int
*/
private function getLatestOldLTS()
public function getLatestOldLTS($fullVersionNumber = false): int
{
return (int)substr($this->coreData['latest_old_lts'], 0, 1);
if ($fullVersionNumber) {
return VersionNumberUtility::convertVersionNumberToInteger($this->coreData['latest_old_lts']);
}
return floor(VersionNumberUtility::convertVersionNumberToInteger($this->coreData['latest_old_lts']) / self::FACTOR_MAIN_VERSION);
}
}
......@@ -109,24 +109,34 @@ class TerIndexer extends \ApacheSolrForTypo3\Solr\IndexQueue\Indexer
}
// does this extension supports different versions?
// @todo: use JSON with all versions to get them
$document->setField('supports7_boolS', false);
$document->setField('supports8_boolS', false);
$document->setField('supports9_boolS', false);
$typo3Support = [];
if (VersionUtility::doesExtensionSupportTypo3Version($extension, 7006000)) {
$typo3Support[] = '7 LTS';
$document->setField('supports7_boolS', true);
$supportMaintainedVersions = [];
$supportDevVersion = '';
$supportOlderVersions = [];
$ltsVersionService = GeneralUtility::makeInstance(\T3o\TerFe2\Service\LTSVersionService::class);
foreach ($ltsVersionService->getCurrentStableVersions(true) as $versionNumber) {
if (VersionUtility::doesExtensionSupportTypo3Version($extension, $versionNumber)) {
$supportMaintainedVersions[] = $ltsVersionService->getVersionLabelOfRelease($versionNumber) . ' LTS';
}
}
if (VersionUtility::doesExtensionSupportTypo3Version($extension, 8007000)) {
$typo3Support[] = '8 LTS';
$document->setField('supports8_boolS', true);
if ($ltsVersionService->getLatestDevelopmentVersion() !== $ltsVersionService->getLatestLTS() && VersionUtility::doesExtensionSupportTypo3Version($extension, $ltsVersionService->getLatestDevelopmentVersion(true))) {
$supportDevVersion = $ltsVersionService->getLatestDevelopmentVersion() . '-dev';
}
if (VersionUtility::doesExtensionSupportTypo3Version($extension, 9005000)) {
$typo3Support[] = '9 LTS';
$document->setField('supports9_boolS', true);
foreach ($ltsVersionService->getOldLTSVersions() as $versionNumber) {
if (VersionUtility::doesExtensionSupportTypo3Version($extension, $versionNumber)) {
$supportOlderVersions[] = $ltsVersionService->getVersionLabelOfRelease($versionNumber) . ' LTS';
}
}
$document->setField('typo3support_stringM', $supportMaintainedVersions);
$facetVersions = $supportMaintainedVersions;
if ($supportDevVersion) {
$facetVersions = array_merge($supportMaintainedVersions, [$supportDevVersion]);
}
$document->setField('typo3support_stringM', $typo3Support);
$document->setField('typo3supportfacets_stringM', $facetVersions);
$document->setField('typo3supportdev_stringS', $supportDevVersion);
$document->setField('typo3supportold_stringM', $supportOlderVersions);
$extensionIcon = $this->getExtensionIcon($itemRecord['ext_key'], $extension->getLastVersion()->getVersionString());
$document->setField('extensionIcon_stringS', $extensionIcon);
......
......@@ -49,7 +49,7 @@ class VersionUtility
public static function doesExtensionSupportTypo3Version(\T3o\TerFe2\Domain\Model\Extension $extension, int $mainVersion): bool
{
foreach ($extension->getVersions() as $version) {
if ($version->hasTypo3Dependency() === false || $version->isLive() === false) {
if ($version->getTypo3Dependency() === null || $version->getReviewState() === \T3o\TerFe2\Domain\Model\Version::VERSION_IS_INSECURE) {
continue;
}
......
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:if condition="{version.matrixOfSupportedTypo3Versions}">
<ul class="list-inline">
<f:for each="{version.matrixOfSupportedTypo3Versions}" key="label" as="supported">
<f:if condition="{supported}">
<li class="list-inline-item badge badge-success">{label}</li>
</f:if>
<f:if condition="{version.typo3Dependency}">
<h4>This version supports TYPO3</h4>
<p>
<f:for each="{version.matrixOfSupportedTypo3Versions}" as="version">
<button class="btn btn-{version.badgeClass} btn-sm mr-2" disabled>{version.label}</button>
</f:for>
</ul>
</p>
</f:if>
</html>
......@@ -90,17 +90,15 @@
<div class="row mb-3">
<div class="col-md-8">
<p itemprop="description">{extension.lastVersion.description}</p>
<h3>
<f:render partial="VersionSupportForTypo3" arguments="{version: extension.lastVersion}" />
</h3>
<f:render partial="VersionSupportForTypo3" arguments="{version: extension.lastVersion}" />
<f:if condition="{extension.composerName}">
<p class="mb-3">
<h3>Composer support</h3>
<h4>Composer support</h4>
<f:render partial="ComposerNameWithClipboard" arguments="{composerName: extension.composerName}" />
</p>
</f:if>
<f:if condition="{extension.tags}">
<h3>Tags</h3>
<h4>Tags</h4>
<p class="tags">
<f:for each="{extension.tags}" as="tag">
<f:link.page class="btn btn-outline-info mb-1" pageUid="{settings.pages.searchResultsPid}" additionalParams="{tx_solr: {filter: {0: 'tags:{tag.title}'}}}">
......@@ -116,16 +114,16 @@
</f:for>
</div>
</f:if>
<h3>
<h4>
<f:translate key="last_upload_comment" />
</h3>
</h4>
<p itemprop="releaseNotes">
<f:format.nl2br>{extension.lastVersion.uploadComment}</f:format.nl2br>
</p>
<f:if condition="{versionHistory->f:count()} >= 1}">
<h3>
<h4>
<f:translate key="downloads_by_version" />
</h3>
</h4>
<script type="text/javascript">
var versionChartData = {extension.downloadsByVersionsAsJson -> f:format.raw()};
</script>
......
......@@ -40,7 +40,15 @@ class LTSVersionServiceTest extends UnitTestCase
*/
public function getCurrentStableVersions()
{
$this->assertSame([7, 8], $this->subject->getCurrentStableVersions());
self::assertSame([8, 9], $this->subject->getCurrentStableVersions());
}
/**
* @test
*/
public function getCurrentStableVersionsAsFullVersionNumber()
{
self::assertSame([8007009, 9005005], $this->subject->getCurrentStableVersions(true));
}
/**
......@@ -48,7 +56,15 @@ class LTSVersionServiceTest extends UnitTestCase
*/
public function getAllMaintainedVersions()
{
$this->assertSame([7, 8, '9.0'], $this->subject->getAllMaintainedVersions());
self::assertSame([8, 9, 10], $this->subject->getAllMaintainedVersions());
}
/**
* @test
*/
public function getAllMaintainedVersionsAsFullVersionNumber()
{
self::assertSame([8007009, 9005005, 10000000], $this->subject->getAllMaintainedVersions(true));
}
/**
......@@ -56,7 +72,7 @@ class LTSVersionServiceTest extends UnitTestCase
*/
public function getLatestVersionOfRelease()
{
$this->assertSame('7.6.21', $this->subject->getLatestVersionOfRelease(7));
self::assertSame('7.6.21', $this->subject->getLatestVersionOfRelease(7));
}
/**
......@@ -64,7 +80,69 @@ class LTSVersionServiceTest extends UnitTestCase
*/
public function getLatestDevelopmentVersion()
{
$this->assertSame('9.0', $this->subject->getLatestDevelopmentVersion());
self::assertSame(10, $this->subject->getLatestDevelopmentVersion());
}
/**
* @test
*/
public function getLatestDevelopmentVersionAsFullVersionNumber()
{
self::assertSame(10000000, $this->subject->getLatestDevelopmentVersion(true));
}
/**
* @test
*/
public function getAllLTSVersionsAsFullVersionNumber()
{
self::assertSame(
[
4005000,
6002000,
7006000,
8007000,
9005000
],
$this->subject->getAllLTSVersions()
);
}
/**
* @test
*/
public function getOldLTSVersionsAsFullVersionNumber()
{
self::assertSame(
[
4005000,
6002000,
7006000
],
$this->subject->getOldLTSVersions()
);
}
/**
* @test
*/
public function getVersionLabelOfNewVersion()
{
self::assertSame(
'8',
$this->subject->getVersionLabelOfRelease(8007004)
);
}
/**
* @test
*/
public function getVersionLabelOfLegacyVersion()
{