partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit 7ea6026b9750726a32b727352b41bf8baaa6ce58
parent 64b5591f270d60cf38eab484d7776c9a52706181
Author: Felicia Hummel <felicitus@felicitus.org>
Date:   Tue, 16 Aug 2016 19:43:40 +0200

Fixed unit test

Diffstat:
Msrc/PartKeepr/CoreBundle/Services/SystemService.php | 2+-
Msrc/PartKeepr/CoreBundle/Services/VersionService.php | 17+++++++++++------
2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/PartKeepr/CoreBundle/Services/SystemService.php b/src/PartKeepr/CoreBundle/Services/SystemService.php @@ -100,7 +100,7 @@ class SystemService extends ContainerAware 'PartKeepr' ); - $aData[] = new SystemInformationRecord('PartKeepr Version', $this->versionService->getVersion(), 'PartKeepr'); + $aData[] = new SystemInformationRecord('PartKeepr Version', $this->versionService->getCanonicalVersion(), 'PartKeepr'); return $aData; } diff --git a/src/PartKeepr/CoreBundle/Services/VersionService.php b/src/PartKeepr/CoreBundle/Services/VersionService.php @@ -39,11 +39,7 @@ class VersionService $this->translator = $translator; $this->remoteFileLoader = $remoteFileLoader; - if (PartKeeprVersion::PARTKEEPR_VERSION == '{V_GIT}') { - $this->setVersion('GIT development version Commit '. $this->extractGITCommit() . " Short Commit " . $this->extractShortGITCommit()); - } else { - $this->setVersion(PartKeeprVersion::PARTKEEPR_VERSION); - } + $this->setVersion(PartKeeprVersion::PARTKEEPR_VERSION); } /** @@ -87,6 +83,14 @@ class VersionService $this->versionURI = $versionURI; } + public function getCanonicalVersion () { + if ($this->getVersion() === '{V_GIT}') { + return 'GIT development version Commit '. $this->extractGITCommit() . " Short Commit " . $this->extractShortGITCommit(); + } else { + return $this->getVersion(); + } + } + /** * Checks against the versions at partkeepr.org. * @@ -94,7 +98,7 @@ class VersionService */ public function doVersionCheck() { - if (PartKeeprVersion::PARTKEEPR_VERSION === '{V_GIT}') { + if ($this->getVersion() === '{V_GIT}') { return; } @@ -108,6 +112,7 @@ class VersionService return; } + echo $this->getVersion(); if (version_compare($this->getVersion(), $latestVersion['version'], '<')) { $this->systemNoticeService->createUniqueSystemNotice( 'PARTKEEPR_VERSION_'.$latestVersion['version'],