/** * @test */ public function shouldMarkUnknownIfStatusNotSupported() { $action = new StatusAction(); $status = new GetBinaryStatus(array('status' => 'not-supported-status')); //guard $status->markNew(); $action->execute($status); $this->assertTrue($status->isUnknown()); }
/** * @test */ public function shouldMarkUnknownIfOrderStatusSupportedButTransactionStatusNotSupported() { $action = new PaymentDetailsStatusAction(); $status = new GetBinaryStatus(array('orderStatus' => OrderApi::ORDERSTATUS_COMPLETED, 'transactionStatus' => 'not-supported-status', 'orderId' => 'anId', 'autoPay' => false)); //guard $status->markNew(); $action->execute($status); $this->assertTrue($status->isUnknown()); }
/** * @test */ public function shouldNotMatchOthersThenNewStatus() { $statusRequest = new GetBinaryStatus(new \stdClass()); $statusRequest->markNew(); $this->assertTrue($statusRequest->isNew()); $this->assertFalse($statusRequest->isCaptured()); $this->assertFalse($statusRequest->isSuspended()); $this->assertFalse($statusRequest->isExpired()); $this->assertFalse($statusRequest->isCanceled()); $this->assertFalse($statusRequest->isPending()); $this->assertFalse($statusRequest->isFailed()); $this->assertFalse($statusRequest->isUnknown()); }
/** * @test */ public function shouldNotMatchOthersThenNewStatus() { $getStatus = new GetBinaryStatus(new \stdClass()); $getStatus->markNew(); $this->assertTrue($getStatus->isNew()); $this->assertFalse($getStatus->isCaptured()); $this->assertFalse($getStatus->isPayedout()); $this->assertFalse($getStatus->isAuthorized()); $this->assertFalse($getStatus->isSuspended()); $this->assertFalse($getStatus->isExpired()); $this->assertFalse($getStatus->isCanceled()); $this->assertFalse($getStatus->isPending()); $this->assertFalse($getStatus->isFailed()); $this->assertFalse($getStatus->isUnknown()); }