2.4 - Faking the Payment Gateway

This commit is contained in:
Adam Wathan
2016-11-08 13:14:52 -05:00
parent 94480e7eac
commit 46640c5096
7 changed files with 95 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
<?php
use App\Billing\FakePaymentGateway;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class FakePaymentGatewayTest extends TestCase
{
/** @test */
function charges_with_a_valid_payment_token_are_successful()
{
$paymentGateway = new FakePaymentGateway;
$paymentGateway->charge(2500, $paymentGateway->getValidTestToken());
$this->assertEquals(2500, $paymentGateway->totalCharges());
}
}