Skip to content

Commit

Permalink
MNT Prevent extension from fetching from github
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Aug 13, 2024
1 parent 5360f75 commit 970d38a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/Tasks/UpdatePackageInfoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function testPackagesAreAddedCorrectly()

$frameworkVersion = VersionProvider::singleton()->getModuleVersion('silverstripe/framework');
$composerLoader = $this->getMockBuilder(ComposerLoader::class)
->setMethods(['getLock'])->getMock();
->setMethods(['getLock', 'getPackages'])->getMock();
$composerLoader->expects($this->any())->method('getLock')->will($this->returnValue(json_decode(<<<LOCK
{
"packages": [
Expand All @@ -69,6 +69,11 @@ public function testPackagesAreAddedCorrectly()
}
LOCK
)));
// prevent extension CheckComposerUpdatesExtension::updatePackageInfo()
// in bringyourownideas/silverstripe-composer-update-checker
// from fetching data from github
$composerLoader->expects($this->any())->method('getPackages')->will($this->returnValue([]));

$task->setComposerLoader($composerLoader);

$task->run(null);
Expand Down

0 comments on commit 970d38a

Please sign in to comment.