예제 #1
0
 /**
  * @test
  */
 public function shouldSubExecuteCreateChargeIfTokenSetButNotUsed()
 {
     $model = array('card' => 'notUsedToken');
     $gatewayMock = $this->createGatewayMock();
     $gatewayMock->expects($this->once())->method('execute')->with($this->isInstanceOf(CreateCharge::class));
     $action = new CaptureAction();
     $action->setGateway($gatewayMock);
     $action->execute(new Capture($model));
 }
예제 #2
0
 /**
  * @test
  */
 public function shouldNotSubExecuteCreateChargeIfCustomerSetButAlreadyCharged()
 {
     $model = ['customer' => 'theCustomerId', 'status' => Constants::STATUS_SUCCEEDED];
     $gatewayMock = $this->createGatewayMock();
     $gatewayMock->expects($this->never())->method('execute');
     $action = new CaptureAction();
     $action->setGateway($gatewayMock);
     $action->execute(new Capture($model));
 }