mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-01-26 03:04:05 +00:00
6.2 - You Might Not Need a Mocking Library
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use App\Ticket;
|
||||
use App\Concert;
|
||||
use App\Reservation;
|
||||
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
||||
@@ -8,13 +9,14 @@ use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
|
||||
class ReservationTest extends TestCase
|
||||
{
|
||||
use DatabaseMigrations;
|
||||
|
||||
/** @test */
|
||||
function calculating_the_total_cost()
|
||||
{
|
||||
$concert = factory(Concert::class)->create(['ticket_price' => 1200])->addTickets(3);
|
||||
$tickets = $concert->findTickets(3);
|
||||
$tickets = collect([
|
||||
(object) ['price' => 1200],
|
||||
(object) ['price' => 1200],
|
||||
(object) ['price' => 1200],
|
||||
]);
|
||||
|
||||
$reservation = new Reservation($tickets);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user