Skip to content
This repository was archived by the owner on Nov 30, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion app/Commands/NewApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,9 @@ public function handle(Git $git)
callout("{$application->name} is ready", [
Element::keyValueList([
'URL' => Element::link($environment->url).($isReady ? '' : ' (still starting)'),
'Local' => $this->tildePath($this->path),
'Dashboard' => Element::link($result['dashboard_url']),
'Repository' => Element::link((new GitHubProvider)->repositoryUrl($application->repositoryFullName ?? $this->form()->get('repository'))),
'Local' => $this->tildePath($this->path),
]),
]);
}
Expand Down
17 changes: 17 additions & 0 deletions tests/Feature/NewApplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
use Saloon\Http\Faking\MockClient;
use Saloon\Http\Faking\MockResponse;
use Saloon\Http\PendingRequest;
use Tests\Fixtures\InteractiveNewApplicationCommand;

beforeEach(function () {
Sleep::fake();
Expand Down Expand Up @@ -425,3 +426,19 @@ function newApplicationDefaultPath(string $home, string $cwd): string
putenv('HOME='.$originalHome);
}
});

it('links the dashboard and repository when the application is ready', function () {
Artisan::registerCommand(new InteractiveNewApplicationCommand);

$exitCode = Artisan::call('test:interactive-new', [
'--starter-kit' => 'go',
'--repository' => 'user/new-app',
'--name' => 'new-app',
'--region' => 'us-east-1',
'--path' => $this->clonePath,
]);

expect($exitCode)->toBe(0)
->and(Artisan::output())
->toMatch('/URL.*\n.*Dashboard.*\n.*Repository.*https:\/\/github\.com\/user\/new-app.*\n.*Local/');
});
36 changes: 36 additions & 0 deletions tests/Fixtures/InteractiveNewApplicationCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

namespace Tests\Fixtures;

use App\Commands\NewApplication;
use App\Prompts\Renderer;
use Laravel\Prompts\Prompt;
use Symfony\Component\Console\Input\InputInterface;

/**
* STDIN is not a TTY under the test runner and agent or CI env vars suppress output,
* so this forces the interactive, rendered path of new.
*/
class InteractiveNewApplicationCommand extends NewApplication
{
public function __construct()
{
$this->signature = preg_replace('/^new/', 'test:interactive-new', $this->signature);

parent::__construct();
}

protected function isInteractive(): bool
{
return true;
}

protected function configurePrompts(InputInterface $input): void
{
Renderer::$suppressOutput = false;

parent::configurePrompts($input);

Prompt::interactive(true);
}
}
Loading