add admin command
This commit is contained in:
parent
4462879b7d
commit
fee174ec05
7 changed files with 120 additions and 0 deletions
|
|
@ -7,6 +7,7 @@ use App\Shared\ValueObject\EmailAddress;
|
|||
use App\User\InitialAdminCredentials;
|
||||
use App\User\InitialAdminCredentialsProvider;
|
||||
use App\User\UseCases\EnsureInitialAdmin\EnsureInitialAdmin;
|
||||
use Illuminate\Container\Container;
|
||||
use Symfony\Component\Console\Tester\CommandTester;
|
||||
use Tests\Fakes\FakeHasher;
|
||||
use Tests\Fakes\FakeUserRepository;
|
||||
|
|
@ -25,6 +26,7 @@ class EnsureInitialAdminCommandTest extends TestCase
|
|||
'secret-password',
|
||||
),
|
||||
);
|
||||
$command->setLaravel($this->consoleContainer());
|
||||
|
||||
$commandTester = new CommandTester($command);
|
||||
$statusCode = $commandTester->execute([]);
|
||||
|
|
@ -67,4 +69,15 @@ class EnsureInitialAdminCommandTest extends TestCase
|
|||
}
|
||||
};
|
||||
}
|
||||
|
||||
private function consoleContainer(): Container
|
||||
{
|
||||
return new class extends Container
|
||||
{
|
||||
public function runningUnitTests(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue