Skip to content

Commit

Permalink
Merge pull request #11166 from creative-commoners/pulls/5/check-exists
Browse files Browse the repository at this point in the history
MNT Ensure composer/semver installed or skip test
  • Loading branch information
GuySartorelli authored Mar 4, 2024
2 parents 4f3282b + a18fb1b commit 054c238
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/php/Core/Manifest/VersionProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function testGetModulesNone()
public function testGetModuleVersionFromComposer()
{
Config::modify()->set(VersionProvider::class, 'modules', [
'silverstripe/siteconfig' => 'SiteConfig',
'silverstripe/config' => 'Config',
'silverstripe/framework' => 'Framework',
]);

Expand All @@ -77,17 +77,20 @@ public function testGetModuleVersionFromComposer()
public function testGetVersion()
{
Config::modify()->set(VersionProvider::class, 'modules', [
'silverstripe/siteconfig' => 'SiteConfig',
'silverstripe/config' => 'Config',
'silverstripe/framework' => 'Framework'
]);
$result = $this->getProvider()->getVersion();
$this->assertStringNotContainsString('SiteConfig: ', $result);
$this->assertStringNotContainsString('Config: ', $result);
$this->assertStringContainsString('Framework: ', $result);
$this->assertStringNotContainsString(', ', $result);
}

public function testGetModuleVersion()
{
if (!class_exists(VersionParser::class)) {
$this->markTestSkipped('This test requires composer/semver to be installed');
}
$provider = $this->getProvider();
Config::modify()->set(VersionProvider::class, 'modules', [
'silverstripe/framework' => 'Framework',
Expand Down

0 comments on commit 054c238

Please sign in to comment.