mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MNT Ensure composer/semver installed or skip test
This commit is contained in:
parent
4f3282bf2a
commit
a18fb1bcb7
@ -65,7 +65,7 @@ class VersionProviderTest extends SapphireTest
|
|||||||
public function testGetModuleVersionFromComposer()
|
public function testGetModuleVersionFromComposer()
|
||||||
{
|
{
|
||||||
Config::modify()->set(VersionProvider::class, 'modules', [
|
Config::modify()->set(VersionProvider::class, 'modules', [
|
||||||
'silverstripe/siteconfig' => 'SiteConfig',
|
'silverstripe/config' => 'Config',
|
||||||
'silverstripe/framework' => 'Framework',
|
'silverstripe/framework' => 'Framework',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -77,17 +77,20 @@ class VersionProviderTest extends SapphireTest
|
|||||||
public function testGetVersion()
|
public function testGetVersion()
|
||||||
{
|
{
|
||||||
Config::modify()->set(VersionProvider::class, 'modules', [
|
Config::modify()->set(VersionProvider::class, 'modules', [
|
||||||
'silverstripe/siteconfig' => 'SiteConfig',
|
'silverstripe/config' => 'Config',
|
||||||
'silverstripe/framework' => 'Framework'
|
'silverstripe/framework' => 'Framework'
|
||||||
]);
|
]);
|
||||||
$result = $this->getProvider()->getVersion();
|
$result = $this->getProvider()->getVersion();
|
||||||
$this->assertStringNotContainsString('SiteConfig: ', $result);
|
$this->assertStringNotContainsString('Config: ', $result);
|
||||||
$this->assertStringContainsString('Framework: ', $result);
|
$this->assertStringContainsString('Framework: ', $result);
|
||||||
$this->assertStringNotContainsString(', ', $result);
|
$this->assertStringNotContainsString(', ', $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetModuleVersion()
|
public function testGetModuleVersion()
|
||||||
{
|
{
|
||||||
|
if (!class_exists(VersionParser::class)) {
|
||||||
|
$this->markTestSkipped('This test requires composer/semver to be installed');
|
||||||
|
}
|
||||||
$provider = $this->getProvider();
|
$provider = $this->getProvider();
|
||||||
Config::modify()->set(VersionProvider::class, 'modules', [
|
Config::modify()->set(VersionProvider::class, 'modules', [
|
||||||
'silverstripe/framework' => 'Framework',
|
'silverstripe/framework' => 'Framework',
|
||||||
|
Loading…
Reference in New Issue
Block a user