From c389d6c7618023c6c5cb01488585df10007f4e7c Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 11 Aug 2023 18:01:54 +0800 Subject: [PATCH] wip Signed-off-by: Mior Muhammad Zaki --- tests/Browser/DatabaseMigrationsTest.php | 3 ++- tests/Browser/RouteTest.php | 17 +++++++++++++++-- .../2014_10_12_000000_create_tests_table.php | 0 3 files changed, 17 insertions(+), 3 deletions(-) rename {tests => workbench/database}/migrations/2014_10_12_000000_create_tests_table.php (100%) diff --git a/tests/Browser/DatabaseMigrationsTest.php b/tests/Browser/DatabaseMigrationsTest.php index 5f6bbd72..24d94a3d 100644 --- a/tests/Browser/DatabaseMigrationsTest.php +++ b/tests/Browser/DatabaseMigrationsTest.php @@ -4,6 +4,7 @@ use Illuminate\Support\Facades\Schema; use Orchestra\Testbench\Dusk\TestCase; +use function Orchestra\Testbench\workbench_path; class DatabaseMigrationsTest extends TestCase { @@ -23,7 +24,7 @@ protected function setUp(): void */ protected function defineDatabaseMigrations() { - $this->loadMigrationsFrom(__DIR__.'/../migrations'); + $this->loadMigrationsFrom(workbench_path('database/migrations')); } /** @test */ diff --git a/tests/Browser/RouteTest.php b/tests/Browser/RouteTest.php index feb34fa5..177862d9 100644 --- a/tests/Browser/RouteTest.php +++ b/tests/Browser/RouteTest.php @@ -15,13 +15,17 @@ class RouteTest extends TestCase */ protected function defineEnvironment($app) { - $app['router']->get('hello', ['as' => 'hi', 'uses' => function () { + $app['router']->get('hello', ['uses' => function () { return 'hello world'; }]); - $app['router']->get('config', ['as' => 'hi', 'uses' => function () { + $app['router']->get('config', ['uses' => function () { return config('new_config_item'); }]); + + $app['router']->get('environment', ['uses' => function () { + return config('app.env'); + }]); } /** @test */ @@ -33,6 +37,15 @@ public function can_use_dusk() }); } + /** @test */ + public function can_return_correct_application_environment() + { + $this->browse(function (Browser $browser) { + $browser->visit('environment') + ->assertSee('testing'); + }); + } + /** @test */ public function can_use_multiple_browsers() { diff --git a/tests/migrations/2014_10_12_000000_create_tests_table.php b/workbench/database/migrations/2014_10_12_000000_create_tests_table.php similarity index 100% rename from tests/migrations/2014_10_12_000000_create_tests_table.php rename to workbench/database/migrations/2014_10_12_000000_create_tests_table.php