mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-02-08 01:50:30 +00:00
64 - Making the Tests Identical
This commit is contained in:
@@ -31,6 +31,13 @@ class FakePaymentGateway implements PaymentGateway
|
||||
$this->charges[] = $amount;
|
||||
}
|
||||
|
||||
public function newChargesDuring($callback)
|
||||
{
|
||||
$chargesFrom = $this->charges->count();
|
||||
$callback($this);
|
||||
return $this->charges->slice($chargesFrom)->values();
|
||||
}
|
||||
|
||||
public function totalCharges()
|
||||
{
|
||||
return $this->charges->sum();
|
||||
|
||||
@@ -7,4 +7,5 @@ interface PaymentGateway
|
||||
public function charge($amount, $token);
|
||||
|
||||
public function getValidTestToken();
|
||||
public function newChargesDuring($callback);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user