Files
ticketbeast/tests/unit/Billing/MockStripePaymentGatewayTest.php
2016-12-31 12:33:18 -05:00

22 lines
581 B
PHP

<?php
use App\Billing\Alternate\StripePaymentGateway;
class MockStripePaymentGatewayTest extends TestCase
{
/** @test */
function charges_with_a_valid_payment_token_are_successful()
{
$stripeClient = Mockery::spy(\Stripe\ApiClient::class);
$paymentGateway = new StripePaymentGateway($stripeClient);
$paymentGateway->charge(2500, 'valid-token');
$stripeClient->shouldHaveReceived('createCharge')->with([
'amount' => 2500,
'source' => 'valid-token',
'currency' => 'usd',
])->once();
}
}