mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
@ -19,7 +19,7 @@ final class PestTestCommand extends Command
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $signature = 'pest:test {name : The name of the file} {--unit : Create a unit test}';
|
protected $signature = 'pest:test {name : The name of the file} {--unit : Create a unit test} {--dusk : Create a Dusk test}';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The console command description.
|
* The console command description.
|
||||||
@ -36,7 +36,7 @@ final class PestTestCommand extends Command
|
|||||||
/** @var string $name */
|
/** @var string $name */
|
||||||
$name = $this->argument('name');
|
$name = $this->argument('name');
|
||||||
|
|
||||||
$type = ((bool) $this->option('unit')) ? 'Unit' : 'Feature';
|
$type = ((bool) $this->option('unit')) ? 'Unit' : (((bool) $this->option('dusk')) ? 'Browser' : 'Feature');
|
||||||
|
|
||||||
$relativePath = sprintf('tests/%s/%s.php',
|
$relativePath = sprintf('tests/%s/%s.php',
|
||||||
$type,
|
$type,
|
||||||
|
|||||||
10
stubs/Browser.php
Normal file
10
stubs/Browser.php
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Laravel\Dusk\Browser;
|
||||||
|
|
||||||
|
it('has {name} page', function () {
|
||||||
|
$this->browse(function (Browser $browser) {
|
||||||
|
$browser->visit('/{name}')
|
||||||
|
->assertSee('{name}');
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user