-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Add] Orchestral Testbench Dusk for real browser based tests,
[Change] Refactor FeatureTestCase into seperate Concern to initialize the app environment, [Add] Browser testsuite using Laravel Dusk throught Orchestral Workbench, [Add] Basic TestCase super for Browser and Unit tests
- Loading branch information
1 parent
bcb9f4a
commit 812752e
Showing
9 changed files
with
97 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace Tests\SkyRaptor\FilamentBlocksBuilder\Browser; | ||
|
||
use Tests\SkyRaptor\FilamentBlocksBuilder\Concerns\RequiresApplicationEnvironment; | ||
|
||
/** | ||
* This class acts as the TestCase super to be extended in | ||
* case a Browser test is implemented. | ||
*/ | ||
class TestCase extends \Orchestra\Testbench\Dusk\TestCase | ||
{ | ||
use RequiresApplicationEnvironment; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
namespace Tests\SkyRaptor\FilamentBlocksBuilder\Concerns; | ||
|
||
use Illuminate\Foundation\Testing\RefreshDatabase; | ||
use Orchestra\Testbench\Attributes\WithMigration; | ||
use Orchestra\Testbench\Concerns\WithWorkbench; | ||
use PHPUnit\Framework\Attributes\Before; | ||
use Workbench\App\Models\User; | ||
|
||
#[WithMigration] | ||
trait RequiresApplicationEnvironment | ||
{ | ||
/* Use Orchestral Testbench's Workbench environment */ | ||
use WithWorkbench; | ||
|
||
/* Ensure the databse is migrated & fresh before each test */ | ||
use RefreshDatabase; | ||
|
||
/** | ||
* The default testing User | ||
*/ | ||
protected User $user; | ||
|
||
/** | ||
* This method is responsible for setting up anything | ||
* implemented throught this Trait by using the | ||
* PHPUnit "setUp" annotation. | ||
* | ||
* @setUp | ||
*/ | ||
protected function setUpRequiresApplicationEnvironment(): void | ||
{ | ||
/* Setup the default testing User */ | ||
$this->user = $this->createUser(); | ||
$this->actingAs($this->user); | ||
} | ||
|
||
/** | ||
* This helper method does create a new | ||
* User using the Model's Factory. | ||
*/ | ||
protected function createUser(): User | ||
{ | ||
return User::factory()->create(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace Tests\SkyRaptor\FilamentBlocksBuilder\Feature; | ||
|
||
use Tests\SkyRaptor\FilamentBlocksBuilder\Concerns\RequiresApplicationEnvironment; | ||
|
||
/** | ||
* This class acts as the TestCase super to be extended in | ||
* case a Feature test is implemented. | ||
*/ | ||
class TestCase extends \Orchestra\Testbench\TestCase | ||
{ | ||
use RequiresApplicationEnvironment; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
namespace Tests\SkyRaptor\FilamentBlocksBuilder\Unit; | ||
|
||
/** | ||
* This class acts as the TestCase super to be extended in | ||
* case a Unit test is implemented. | ||
*/ | ||
class TestCase extends \Orchestra\Testbench\TestCase | ||
{ | ||
// | ||
} |