From a18fb1bcb7d521903e7d00658efc6a1595c2ee95 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Mon, 4 Mar 2024 12:52:17 +1300 Subject: [PATCH] MNT Ensure composer/semver installed or skip test --- tests/php/Core/Manifest/VersionProviderTest.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/php/Core/Manifest/VersionProviderTest.php b/tests/php/Core/Manifest/VersionProviderTest.php index 96e62795a..9e585f5ea 100644 --- a/tests/php/Core/Manifest/VersionProviderTest.php +++ b/tests/php/Core/Manifest/VersionProviderTest.php @@ -65,7 +65,7 @@ class VersionProviderTest extends SapphireTest public function testGetModuleVersionFromComposer() { Config::modify()->set(VersionProvider::class, 'modules', [ - 'silverstripe/siteconfig' => 'SiteConfig', + 'silverstripe/config' => 'Config', 'silverstripe/framework' => 'Framework', ]); @@ -77,17 +77,20 @@ class VersionProviderTest extends SapphireTest 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',