Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MNT Ensure composer/semver installed or skip test #11166

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading