mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
use VersionParser instead of comparator
This commit is contained in:
parent
80e197fe4f
commit
a06ce0493a
@ -3,7 +3,7 @@
|
|||||||
namespace SilverStripe\Core\Tests\Manifest;
|
namespace SilverStripe\Core\Tests\Manifest;
|
||||||
|
|
||||||
use SebastianBergmann\Version;
|
use SebastianBergmann\Version;
|
||||||
use Composer\Semver\Comparator;
|
use Composer\Semver\VersionParser;
|
||||||
use SilverStripe\Dev\SapphireTest;
|
use SilverStripe\Dev\SapphireTest;
|
||||||
use Psr\SimpleCache\CacheInterface;
|
use Psr\SimpleCache\CacheInterface;
|
||||||
use SilverStripe\Core\Config\Config;
|
use SilverStripe\Core\Config\Config;
|
||||||
@ -93,7 +93,8 @@ class VersionProviderTest extends SapphireTest
|
|||||||
'silverstripe/framework' => 'Framework',
|
'silverstripe/framework' => 'Framework',
|
||||||
]);
|
]);
|
||||||
$moduleVersion = $provider->getModuleVersion('silverstripe/framework');
|
$moduleVersion = $provider->getModuleVersion('silverstripe/framework');
|
||||||
$this->assertTrue(Comparator::greaterThanOrEqualTo($moduleVersion, '5.0.0'), "Expected > 5.0.0 but got $moduleVersion");
|
$parser = new VersionParser();
|
||||||
|
$this->assertIsString($parser->normalize($moduleVersion), "Expected a valid semver but got $moduleVersion");
|
||||||
$result = $provider->getVersion();
|
$result = $provider->getVersion();
|
||||||
$this->assertStringNotContainsString('Framework: 1.2.3', $result);
|
$this->assertStringNotContainsString('Framework: 1.2.3', $result);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user