diff --git a/tests/Http/AuthorizationTest.php b/tests/Http/AuthorizationTest.php index 8e3b5ee59..1ce2fe2c2 100644 --- a/tests/Http/AuthorizationTest.php +++ b/tests/Http/AuthorizationTest.php @@ -9,6 +9,7 @@ use Laravel\Telescope\TelescopeApplicationServiceProvider; use Laravel\Telescope\Tests\FeatureTestCase; use Orchestra\Testbench\Http\Middleware\VerifyCsrfToken; +use Illuminate\Foundation\Http\Middleware\ValidateCsrfToken; class AuthorizationTest extends FeatureTestCase { @@ -25,6 +26,7 @@ protected function setUp(): void parent::setUp(); $this->withoutMiddleware([VerifyCsrfToken::class]); + $this->withoutMiddleware([ValidateCsrfToken::class]); } protected function tearDown(): void diff --git a/tests/Http/AvatarTest.php b/tests/Http/AvatarTest.php index 4560f042a..ebd4cb3c1 100644 --- a/tests/Http/AvatarTest.php +++ b/tests/Http/AvatarTest.php @@ -41,7 +41,6 @@ public function it_can_register_custom_avatar_path() $this->loadLaravelMigrations(); $user = UserEloquent::create([ - 'id' => 1, 'name' => 'Telescope', 'email' => 'telescope@laravel.com', 'password' => 'secret', @@ -66,7 +65,7 @@ public function it_can_register_custom_avatar_path() 'entry' => [ 'content' => [ 'user' => [ - 'avatar' => '/images/1.jpg', + 'avatar' => '/images/'.$user->id.'.jpg', ], ], ], diff --git a/tests/Http/RouteTest.php b/tests/Http/RouteTest.php index 991542b06..2a315c617 100644 --- a/tests/Http/RouteTest.php +++ b/tests/Http/RouteTest.php @@ -8,6 +8,7 @@ use Laravel\Telescope\Http\Middleware\Authorize; use Laravel\Telescope\Tests\FeatureTestCase; use Orchestra\Testbench\Http\Middleware\VerifyCsrfToken; +use Illuminate\Foundation\Http\Middleware\ValidateCsrfToken; use PHPUnit\Framework\Assert as PHPUnit; class RouteTest extends FeatureTestCase @@ -16,7 +17,7 @@ protected function setUp(): void { parent::setUp(); - $this->withoutMiddleware([Authorize::class, VerifyCsrfToken::class]); + $this->withoutMiddleware([Authorize::class, VerifyCsrfToken::class, ValidateCsrfToken::class]); $this->registerAssertJsonExactFragmentMacro(); } diff --git a/tests/Watchers/BatchWatcherTest.php b/tests/Watchers/BatchWatcherTest.php index 112692787..97a7c26f7 100644 --- a/tests/Watchers/BatchWatcherTest.php +++ b/tests/Watchers/BatchWatcherTest.php @@ -78,15 +78,17 @@ public function test_job_dispatch_registers_entries() private function createJobsTable(): void { - Schema::create('jobs', function (Blueprint $table) { - $table->bigIncrements('id'); - $table->string('queue')->index(); - $table->longText('payload'); - $table->unsignedTinyInteger('attempts'); - $table->unsignedInteger('reserved_at')->nullable(); - $table->unsignedInteger('available_at'); - $table->unsignedInteger('created_at'); - }); + if (! Schema::hasTable('jobs')) { + Schema::create('jobs', function (Blueprint $table) { + $table->bigIncrements('id'); + $table->string('queue')->index(); + $table->longText('payload'); + $table->unsignedTinyInteger('attempts'); + $table->unsignedInteger('reserved_at')->nullable(); + $table->unsignedInteger('available_at'); + $table->unsignedInteger('created_at'); + }); + } Schema::create('job_batches', function ($table) { $table->string('id')->primary(); diff --git a/tests/Watchers/ModelWatcherTest.php b/tests/Watchers/ModelWatcherTest.php index ca06868c2..2816182ba 100644 --- a/tests/Watchers/ModelWatcherTest.php +++ b/tests/Watchers/ModelWatcherTest.php @@ -30,7 +30,7 @@ public function test_model_watcher_registers_entry() $this->loadLaravelMigrations(); }); - UserEloquent::query() + $user = UserEloquent::query() ->create([ 'name' => 'Telescope', 'email' => 'telescope@laravel.com', @@ -41,7 +41,7 @@ public function test_model_watcher_registers_entry() $this->assertSame(EntryType::MODEL, $entry->type); $this->assertSame('created', $entry->content['action']); - $this->assertSame(UserEloquent::class.':1', $entry->content['model']); + $this->assertSame(UserEloquent::class.':'.$user->id, $entry->content['model']); } public function test_model_watcher_can_restrict_events() @@ -65,7 +65,7 @@ public function test_model_watcher_can_restrict_events() $this->assertCount(1, $entries); $this->assertSame(EntryType::MODEL, $entry->type); $this->assertSame('created', $entry->content['action']); - $this->assertSame(UserEloquent::class.':1', $entry->content['model']); + $this->assertSame(UserEloquent::class.':'.$user->id, $entry->content['model']); } public function test_model_watcher_registers_hydration_entry()