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