Skip to content

Instantly share code, notes, and snippets.

@DominikStyp
Created August 7, 2023 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DominikStyp/17e47af8f9fc3296fa8350dd4b262804 to your computer and use it in GitHub Desktop.
Save DominikStyp/17e47af8f9fc3296fa8350dd4b262804 to your computer and use it in GitHub Desktop.
Laravel 10 + PHPUnit: Call artisan command with options
<?php
class CallArtisanWithOptions {
public function test_migrate_documents(): void
{
$this->artisan('app:migrate-ftp-documents-to-local-storage')
->expectsChoice(
'Are you sure you want to migrate all documents from FTP to local storage?',
'yes',
['yes', 'no']
)->expectsChoice(
'Files from which environment you want to migrate?',
'local',
['local', 'testing', 'acceptance', 'production']
)->assertExitCode(0);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment