diff --git a/tests/Models/MetaTest.php b/tests/Models/MetaTest.php new file mode 100644 index 00000000..6c40b18b --- /dev/null +++ b/tests/Models/MetaTest.php @@ -0,0 +1,37 @@ +user = User::factory()->create(); + } + + public function test_a_meta_belongs_to_a_metable(): void + { + $meta = Meta::factory()->make(); + + $meta->metable()->associate($this->user)->save(); + + $this->assertTrue($meta->metable->is($this->user)); + } + + public function test_a_metable_model_has_meta_data(): void + { + $this->user->metaData()->save( + $meta = Meta::factory()->make() + ); + + $this->assertTrue($this->user->metaData->contains($meta)); + } +} diff --git a/tests/Models/NotificationTest.php b/tests/Models/NotificationTest.php new file mode 100644 index 00000000..5d5dd6b9 --- /dev/null +++ b/tests/Models/NotificationTest.php @@ -0,0 +1,30 @@ +user = User::factory()->create(); + } + + public function test_a_notification_belongs_to_a_notifiable(): void + { + $notification = Notification::factory()->make(); + + $notification->notifiable()->associate($this->user); + + $notification->save(); + + $this->assertTrue($notification->notifiable->is($this->user)); + } +}