29 lines
704 B
PHP
29 lines
704 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Illuminate\Console\Command;
|
|
use Illuminate\Testing\PendingCommand;
|
|
use Webmozart\Assert\Assert;
|
|
|
|
afterEach(function (): void {
|
|
\Mockery::close();
|
|
});
|
|
|
|
describe('UpsertEmployeesFormFile command', function (): void {
|
|
it('returns failure when input file does not exist', function (): void {
|
|
/** @var \Tests\TestCase $this */
|
|
// GIVEN
|
|
$filePath = '/tmp/does-not-exist.csv';
|
|
|
|
// WHEN
|
|
$result = $this->artisan('uwil:employees:upsert', [
|
|
'file' => $filePath,
|
|
]);
|
|
|
|
Assert::isInstanceOf($result, PendingCommand::class);
|
|
|
|
// THEN
|
|
$result->assertExitCode(Command::FAILURE);
|
|
});
|
|
});
|