62 - Refactoring Towards Duplication

This commit is contained in:
Adam Wathan
2017-01-17 19:57:34 -05:00
parent 74ed409e46
commit f1a57e27f6
4 changed files with 32 additions and 5 deletions

View File

@@ -8,10 +8,15 @@ use Illuminate\Foundation\Testing\DatabaseTransactions;
class FakePaymentGatewayTest extends TestCase
{
protected function getPaymentGateway()
{
return new FakePaymentGateway;
}
/** @test */
function charges_with_a_valid_payment_token_are_successful()
{
$paymentGateway = new FakePaymentGateway;
$paymentGateway = $this->getPaymentGateway();
$paymentGateway->charge(2500, $paymentGateway->getValidTestToken());