mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-01-31 20:46:57 +00:00
87 - Feature Test and JSON Updates
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
use App\Concert;
|
||||
use App\Billing\PaymentGateway;
|
||||
use App\Billing\FakePaymentGateway;
|
||||
use App\Facades\OrderConfirmationNumber;
|
||||
use App\OrderConfirmationNumberGenerator;
|
||||
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
@@ -52,10 +53,7 @@ class PurchaseTicketsTest extends TestCase
|
||||
{
|
||||
$this->disableExceptionHandling();
|
||||
|
||||
$orderConfirmationNumberGenerator = Mockery::mock(OrderConfirmationNumberGenerator::class, [
|
||||
'generate' => 'ORDERCONFIRMATION1234',
|
||||
]);
|
||||
$this->app->instance(OrderConfirmationNumberGenerator::class, $orderConfirmationNumberGenerator);
|
||||
OrderConfirmationNumber::shouldReceive('generate')->andReturn('ORDERCONFIRMATION1234');
|
||||
|
||||
$concert = factory(Concert::class)->states('published')->create(['ticket_price' => 3250])->addTickets(3);
|
||||
|
||||
@@ -70,8 +68,12 @@ class PurchaseTicketsTest extends TestCase
|
||||
$this->seeJsonSubset([
|
||||
'confirmation_number' => 'ORDERCONFIRMATION1234',
|
||||
'email' => 'john@example.com',
|
||||
'ticket_quantity' => 3,
|
||||
'amount' => 9750,
|
||||
'tickets' => [
|
||||
['code' => 'TICKETCODE1'],
|
||||
['code' => 'TICKETCODE2'],
|
||||
['code' => 'TICKETCODE3'],
|
||||
]
|
||||
]);
|
||||
|
||||
$this->assertEquals(9750, $this->paymentGateway->totalCharges());
|
||||
|
||||
Reference in New Issue
Block a user