Summer Sale! All accounts are 50% off this week.

BernardoBF4's avatar

Relationship testing

A test that validates if a certain model has relationship to another model, like the test bellow, should be inside Unit or Feature tests?

public function it_belongs_to_an_event()
  {
    $ticket = Ticket::factory()->create();

    $this->assertInstanceOf(Event::class, $ticket->event);
  }
0 likes
1 reply
kevinbui's avatar

I don't think we need a test case for a relationship. Relationships are part of the framework and already tested.

Please or to participate in this conversation.