mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-01-26 11:14:06 +00:00
2.6 - Encapsulating Relationship Logic in the Model
This commit is contained in:
@@ -53,4 +53,15 @@ class ConcertTest extends TestCase
|
||||
$this->assertTrue($publishedConcerts->contains($publishedConcertB));
|
||||
$this->assertFalse($publishedConcerts->contains($unpublishedConcert));
|
||||
}
|
||||
|
||||
/** @test */
|
||||
function can_order_concert_tickets()
|
||||
{
|
||||
$concert = factory(Concert::class)->create();
|
||||
|
||||
$order = $concert->orderTickets('jane@example.com', 3);
|
||||
|
||||
$this->assertEquals('jane@example.com', $order->email);
|
||||
$this->assertEquals(3, $order->tickets()->count());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user