Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danepowell committed Sep 9, 2024
1 parent 448077e commit c695155
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/Command/CommandBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -1197,6 +1197,9 @@ public function checkForNewVersion(): bool|string
if (AcquiaDrupalEnvironmentDetector::isAhIdeEnv()) {
return false;
}
if ($this->getApplication()->getVersion() === 'dev-unknown') {
return false;
}
try {
if (!$this->selfUpdateManager->isUpToDate()) {
return $this->selfUpdateManager->getLatestReleaseFromGithub()['tag_name'];
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/src/Application/KernelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function testRun(): void
private function getStart(): string
{
return <<<EOD
Acquia CLI
Acquia CLI dev-unknown
Usage:
command [options] [arguments]
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/src/ApplicationTestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function setUp(): void
protected function runApp(): string
{
putenv("ACLI_REPO_ROOT=" . $this->projectDir);
putenv("ACLI_VERSION=" . 'UNKNOWN');
putenv("ACLI_VERSION=" . 'dev-unknown');
$input = $this->kernel->getContainer()->get(InputInterface::class);
$output = $this->kernel->getContainer()->get(OutputInterface::class);
/** @var Application $application */
Expand Down
4 changes: 3 additions & 1 deletion tests/phpunit/src/TestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ protected function setUp(): void
$this->consoleOutput = new ConsoleOutput();
$this->setClientProphecies();
$this->setIo();
$this->selfUpdateManager = $this->prophet->prophesize(SelfUpdateManager::class)->reveal();
$selfUpdateManagerProphecy = $this->prophet->prophesize(SelfUpdateManager::class);
$selfUpdateManagerProphecy->isUpToDate()->willReturn(true);
$this->selfUpdateManager = $selfUpdateManagerProphecy->reveal();

$this->vfsRoot = vfsStream::setup();
$this->projectDir = vfsStream::newDirectory('project')
Expand Down

0 comments on commit c695155

Please sign in to comment.