Files
ticketbeast/tests/unit/TicketTest.php
2016-11-15 13:22:44 -05:00

26 lines
666 B
PHP

<?php
use App\Concert;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class TicketTest extends TestCase
{
use DatabaseMigrations;
/** @test */
function a_ticket_can_be_released()
{
$concert = factory(Concert::class)->create();
$concert->addTickets(1);
$order = $concert->orderTickets('jane@example.com', 1);
$ticket = $order->tickets()->first();
$this->assertEquals($order->id, $ticket->order_id);
$ticket->release();
$this->assertNull($ticket->fresh()->order_id);
}
}