/** * @test */ public function shouldMarkCanceledIfPaymentBatchNumIsZero() { $action = new StatusAction(); $model = [Api::FIELD_PAYMENT_BATCH_NUM => 0]; $action->execute($status = new GetHumanStatus($model)); $this->assertTrue($status->isCanceled()); }
/** * @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()); }
/** * @test */ public function shouldMarkCanceledIfCanceledPropertySet() { $action = new StatusAction(); $action->execute($getStatus = new GetHumanStatus(array('canceled' => true))); $this->assertTrue($getStatus->isCanceled()); }
/** * @test */ public function shouldMarkCanceledIfAuthResultIsCanceled() { $action = new StatusAction(); $action->execute($status = new GetHumanStatus(['authResult' => 'CANCELLED'])); $this->assertTrue($status->isCanceled()); }
/** * @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()); }