Exemplo n.º 1
0
 /**
  * @test
  */
 public function shouldNotMarkRefundedIfStatusNotSetAndRefundedTrue()
 {
     $action = new StatusAction();
     $model = array('refunded' => true);
     $action->execute($status = new GetHumanStatus($model));
     $this->assertFalse($status->isRefunded());
     $this->assertTrue($status->isNew());
 }
Exemplo n.º 2
0
 /**
  * @test
  */
 public function shouldNotMatchOthersThenCapturedStatus()
 {
     $statusRequest = new GetHumanStatus(new \stdClass());
     $statusRequest->markCaptured();
     $this->assertTrue($statusRequest->isCaptured());
     $this->assertFalse($statusRequest->isCanceled());
     $this->assertFalse($statusRequest->isSuspended());
     $this->assertFalse($statusRequest->isAuthorized());
     $this->assertFalse($statusRequest->isRefunded());
     $this->assertFalse($statusRequest->isExpired());
     $this->assertFalse($statusRequest->isPending());
     $this->assertFalse($statusRequest->isFailed());
     $this->assertFalse($statusRequest->isNew());
     $this->assertFalse($statusRequest->isUnknown());
 }
Exemplo n.º 3
0
 /**
  * @test
  */
 public function shouldMarkRefundedIfStatusIsPartaillyRefunded()
 {
     $action = new StatusAction();
     $action->execute($status = new GetHumanStatus(['http_status_code' => 200, 'transaction' => ['response_code' => 20000, 'status' => 'partially_refunded']]));
     $this->assertTrue($status->isRefunded());
 }
Exemplo n.º 4
0
 /**
  * @test
  */
 public function shouldMarkRefundedIfAuthResultIsRefund()
 {
     $action = new StatusAction();
     $action->execute($status = new GetHumanStatus(['authResult' => 'REFUND']));
     $this->assertTrue($status->isRefunded());
 }
Exemplo n.º 5
0
 /**
  * @test
  */
 public function shouldMarkRefundedIfRefundInvoiceNumberSet()
 {
     $action = new StatusAction();
     $action->execute($getStatus = new GetHumanStatus(array('refund_invoice_number' => 'aNum')));
     $this->assertTrue($getStatus->isRefunded());
 }