create(); $this->assertNotNull($scenario->uuid); $this->assertTrue(Str::isUuid($scenario->uuid)); } public function test_uuid_is_not_overwritten_when_provided(): void { $customUuid = (string) Str::uuid(); $scenario = Scenario::factory()->create(['uuid' => $customUuid]); $this->assertEquals($customUuid, $scenario->uuid); } public function test_route_key_name_returns_uuid(): void { $scenario = Scenario::factory()->create(); $this->assertEquals('uuid', $scenario->getRouteKeyName()); } public function test_each_model_gets_a_unique_uuid(): void { $a = Scenario::factory()->create(); $b = Scenario::factory()->create(); $this->assertNotEquals($a->uuid, $b->uuid); } public function test_all_uuid_models_have_correct_route_key_name(): void { $scenario = Scenario::factory()->create(); $bucket = Bucket::factory()->create(['scenario_id' => $scenario->id]); $stream = Stream::factory()->create(['scenario_id' => $scenario->id]); $this->assertEquals('uuid', $bucket->getRouteKeyName()); $this->assertEquals('uuid', $stream->getRouteKeyName()); $this->assertTrue(Str::isUuid($bucket->uuid)); $this->assertTrue(Str::isUuid($stream->uuid)); } }