コード例 #1
0
 /**
  * @test
  */
 public function shouldMarkCanceledIfPaymentBatchNumIsZero()
 {
     $action = new StatusAction();
     $model = [Api::FIELD_PAYMENT_BATCH_NUM => 0];
     $action->execute($status = new GetHumanStatus($model));
     $this->assertTrue($status->isCanceled());
 }
コード例 #2
0
 /**
  * @test
  */
 public function shouldNotMatchOthersThenSuspendedStatus()
 {
     $statusRequest = new GetHumanStatus(new \stdClass());
     $statusRequest->markSuspended();
     $this->assertTrue($statusRequest->isSuspended());
     $this->assertFalse($statusRequest->isCaptured());
     $this->assertFalse($statusRequest->isExpired());
     $this->assertFalse($statusRequest->isCanceled());
     $this->assertFalse($statusRequest->isPending());
     $this->assertFalse($statusRequest->isFailed());
     $this->assertFalse($statusRequest->isNew());
     $this->assertFalse($statusRequest->isUnknown());
 }
コード例 #3
0
ファイル: StatusActionTest.php プロジェクト: Studio-40/Payum
 /**
  * @test
  */
 public function shouldMarkCanceledIfCanceledPropertySet()
 {
     $action = new StatusAction();
     $action->execute($getStatus = new GetHumanStatus(array('canceled' => true)));
     $this->assertTrue($getStatus->isCanceled());
 }
コード例 #4
0
 /**
  * @test
  */
 public function shouldMarkCanceledIfAuthResultIsCanceled()
 {
     $action = new StatusAction();
     $action->execute($status = new GetHumanStatus(['authResult' => 'CANCELLED']));
     $this->assertTrue($status->isCanceled());
 }
コード例 #5
0
ファイル: GetHumanStatusTest.php プロジェクト: payum/core
 /**
  * @test
  */
 public function shouldNotMatchOthersThenPayedoutStatus()
 {
     $getStatus = new GetHumanStatus(new \stdClass());
     $getStatus->markPayedout();
     $this->assertTrue($getStatus->isPayedout());
     $this->assertFalse($getStatus->isCaptured());
     $this->assertFalse($getStatus->isAuthorized());
     $this->assertFalse($getStatus->isExpired());
     $this->assertFalse($getStatus->isCanceled());
     $this->assertFalse($getStatus->isPending());
     $this->assertFalse($getStatus->isFailed());
     $this->assertFalse($getStatus->isNew());
     $this->assertFalse($getStatus->isUnknown());
 }