Merge pull request #223 from clmntgr/support-pest-command

Add a dusk command for Laravel
This commit is contained in:
Nuno Maduro
2020-11-28 18:46:51 +01:00
committed by GitHub
3 changed files with 50 additions and 0 deletions

View File

@ -44,6 +44,7 @@
"require-dev": {
"illuminate/console": "^7.16.1",
"illuminate/support": "^7.16.1",
"laravel/dusk": "^6.9.0",
"mockery/mockery": "^1.4.1",
"pestphp/pest-dev-tools": "dev-master"
},

View File

@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
namespace Pest\Laravel\Commands;
use Laravel\Dusk\Console\DuskCommand;
/**
* @internal
*/
final class PestDuskCommand extends DuskCommand
{
/**
* The console command name.
*
* @var string
*/
protected $signature = 'pest:dusk {--without-tty : Disable output to TTY}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Run the Dusk tests for the application with Pest';
/**
* Get the PHP binary to execute.
*
* @return array<string>
*/
protected function binary()
{
if ('phpdbg' === PHP_SAPI) {
return [PHP_BINARY, '-qrr', 'vendor/bin/pest'];
}
return [PHP_BINARY, 'vendor/bin/pest'];
}
}

View File

@ -5,7 +5,9 @@ declare(strict_types=1);
namespace Pest\Laravel;
use Illuminate\Support\ServiceProvider;
use Laravel\Dusk\Console\DuskCommand;
use Pest\Laravel\Commands\PestDatasetCommand;
use Pest\Laravel\Commands\PestDuskCommand;
use Pest\Laravel\Commands\PestInstallCommand;
use Pest\Laravel\Commands\PestTestCommand;
@ -22,6 +24,12 @@ final class PestServiceProvider extends ServiceProvider
PestTestCommand::class,
PestDatasetCommand::class,
]);
if (class_exists(DuskCommand::class)) {
$this->commands([
PestDuskCommand::class,
]);
}
}
}
}