More unit tests

This commit is contained in:
Dennis Eichhorn 2017-11-25 17:29:17 +01:00
parent 202fdd44df
commit c0ccccd120
2 changed files with 16 additions and 11 deletions

View File

@ -12,8 +12,12 @@
* @link http://website.orange-management.de
*/
declare(strict_types = 1);
namespace Modules\Billing\Models;
use phpOMS\Localization\ISO4217CharEnum;
use phpOMS\Localization\Money;
/**
* Invoice class.
*
@ -41,7 +45,7 @@ class Invoice implements \JsonSerializable
* @var int
* @since 1.0.0
*/
private $type = InvoiceType::Bill;
private $type = InvoiceType::BILL;
/**
* Invoice status.
@ -49,7 +53,7 @@ class Invoice implements \JsonSerializable
* @var int
* @since 1.0.0
*/
private $status = InvoiceStatus::DONE;
private $status = InvoiceStatus::DRAFT;
/**
* Invoice created at.
@ -103,7 +107,7 @@ class Invoice implements \JsonSerializable
*/
private $referer = 0;
private $refererName = 0;
private $refererName = '';
private $taxId = '';
@ -146,13 +150,12 @@ class Invoice implements \JsonSerializable
public function __construct()
{
$insurance = new Money();
$freight = new Money();
$net = new Money();
$gross = new Money();
$this->insurance = new Money();
$this->freight = new Money();
$this->net = new Money();
$this->gross = new Money();
$this->createdAt = new \DateTime();
$this->send = new \DateTime();
}
public function getId() : int
@ -185,7 +188,7 @@ class Invoice implements \JsonSerializable
return $this->status;
}
public function setSatus(int $status) /* : void */
public function setStatus(int $status) /* : void */
{
$this->status = $status;
}
@ -200,7 +203,7 @@ class Invoice implements \JsonSerializable
$this->send = $send;
}
public function getSend() : \DateTime
public function getSend()
{
return $this->send;
}

View File

@ -29,5 +29,7 @@ abstract class InvoiceStatus extends Enum
{
/* public */ const ACTIVE = 1;
/* public */ const ARCHIVED = 2;
/* public */ const DELETED = 3;
/* public */ const DELETED = 4;
/* public */ const DONE = 8;
/* public */ const DRAFT = 16;
}