mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-02-03 01:48:07 +00:00
2.9 - Handling Failed Charges
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use App\Billing\FakePaymentGateway;
|
||||
use App\Billing\PaymentFailedException;
|
||||
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
@@ -16,4 +17,17 @@ class FakePaymentGatewayTest extends TestCase
|
||||
|
||||
$this->assertEquals(2500, $paymentGateway->totalCharges());
|
||||
}
|
||||
|
||||
/** @test */
|
||||
function charges_with_an_invalid_payment_token_fail()
|
||||
{
|
||||
try {
|
||||
$paymentGateway = new FakePaymentGateway;
|
||||
$paymentGateway->charge(2500, 'invalid-payment-token');
|
||||
} catch (PaymentFailedException $e) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->fail();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user