4.2 - Returning Order Details

This commit is contained in:
Adam Wathan
2016-11-16 18:16:55 -05:00
parent 709e87bf69
commit 0f6993c505
3 changed files with 32 additions and 1 deletions

View File

@@ -10,6 +10,21 @@ class OrderTest extends TestCase
{
use DatabaseMigrations;
/** @test */
function converting_to_an_array()
{
$concert = factory(Concert::class)->create(['ticket_price' => 1200])->addTickets(5);
$order = $concert->orderTickets('jane@example.com', 5);
$result = $order->toArray();
$this->assertEquals([
'email' => 'jane@example.com',
'ticket_quantity' => 5,
'amount' => 6000,
], $result);
}
/** @test */
function tickets_are_released_when_an_order_is_cancelled()
{