mirror of
https://github.com/pestphp/pest.git
synced 2026-03-12 02:37:22 +01:00
Merge pull request #223 from clmntgr/support-pest-command
Add a dusk command for Laravel
This commit is contained in:
@ -44,6 +44,7 @@
|
|||||||
"require-dev": {
|
"require-dev": {
|
||||||
"illuminate/console": "^7.16.1",
|
"illuminate/console": "^7.16.1",
|
||||||
"illuminate/support": "^7.16.1",
|
"illuminate/support": "^7.16.1",
|
||||||
|
"laravel/dusk": "^6.9.0",
|
||||||
"mockery/mockery": "^1.4.1",
|
"mockery/mockery": "^1.4.1",
|
||||||
"pestphp/pest-dev-tools": "dev-master"
|
"pestphp/pest-dev-tools": "dev-master"
|
||||||
},
|
},
|
||||||
|
|||||||
41
src/Laravel/Commands/PestDuskCommand.php
Normal file
41
src/Laravel/Commands/PestDuskCommand.php
Normal 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'];
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -5,7 +5,9 @@ declare(strict_types=1);
|
|||||||
namespace Pest\Laravel;
|
namespace Pest\Laravel;
|
||||||
|
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Laravel\Dusk\Console\DuskCommand;
|
||||||
use Pest\Laravel\Commands\PestDatasetCommand;
|
use Pest\Laravel\Commands\PestDatasetCommand;
|
||||||
|
use Pest\Laravel\Commands\PestDuskCommand;
|
||||||
use Pest\Laravel\Commands\PestInstallCommand;
|
use Pest\Laravel\Commands\PestInstallCommand;
|
||||||
use Pest\Laravel\Commands\PestTestCommand;
|
use Pest\Laravel\Commands\PestTestCommand;
|
||||||
|
|
||||||
@ -22,6 +24,12 @@ final class PestServiceProvider extends ServiceProvider
|
|||||||
PestTestCommand::class,
|
PestTestCommand::class,
|
||||||
PestDatasetCommand::class,
|
PestDatasetCommand::class,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
if (class_exists(DuskCommand::class)) {
|
||||||
|
$this->commands([
|
||||||
|
PestDuskCommand::class,
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user