Implement more tests

This commit is contained in:
Dennis Eichhorn 2017-11-25 16:06:53 +01:00
parent 4e7ce69e6b
commit 062dd18e86
16 changed files with 49 additions and 897 deletions

View File

@ -24,7 +24,7 @@ namespace Modules\Accounting\Models;
* @link http://website.orange-management.de * @link http://website.orange-management.de
* @since 1.0.0 * @since 1.0.0
*/ */
abstract class AccountAbstract implements AccountInterface abstract class AccountAbstract
{ {
/** /**
@ -43,7 +43,9 @@ abstract class AccountAbstract implements AccountInterface
*/ */
protected $type = null; protected $type = null;
protected $parent = null; protected $positiveParent = null;
protected $negativeParent = null;
/** /**
* Entry list. * Entry list.
@ -51,7 +53,7 @@ abstract class AccountAbstract implements AccountInterface
* @var \Modules\Accounting\Models\EntryInterface[] * @var \Modules\Accounting\Models\EntryInterface[]
* @since 1.0.0 * @since 1.0.0
*/ */
protected $entryList = 0; protected $entryList = [];
/** /**
* Constructor. * Constructor.
@ -60,11 +62,16 @@ abstract class AccountAbstract implements AccountInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function __construct($id) public function __construct(int $id = 0)
{ {
$this->id = $id; $this->id = $id;
} }
public function getId() : int
{
return $this->id;
}
/** /**
* Get entry. * Get entry.
* *
@ -92,4 +99,24 @@ abstract class AccountAbstract implements AccountInterface
public function getEntriesByDate($start, $end, $dateType = TimeRangeType::RECEIPT_DATE) public function getEntriesByDate($start, $end, $dateType = TimeRangeType::RECEIPT_DATE)
{ {
} }
public function getPositiveParent()
{
return $this->positiveParent;
}
public function setPositiveParent($parent)
{
$this->positiveParent = $parent;
}
public function getNegativeParent()
{
return $this->negativeParent;
}
public function setNegativeParent($parent)
{
$this->negativeParent = $parent;
}
} }

View File

@ -1,198 +0,0 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types = 1);
namespace Modules\Accounting\Models;
/**
* Account balance class.
*
* @category Modules
* @package Modules\Accounting\Models
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
abstract class AccountBalance
{
/**
* Id.
*
* @var int
* @since 1.0.0
*/
private $id = null;
/**
* Time range start.
*
* @var \DateTime
* @since 1.0.0
*/
private $start = null;
/**
* Time range end.
*
* @var \DateTime
* @since 1.0.0
*/
private $end = null;
/**
* Time range type.
*
* @var \Modules\Accounting\Models\TimeRangeType
* @since 1.0.0
*/
private $rangetype = null;
/**
* Account.
*
* @var \Modules\Accounting\Models\AccountInterface
* @since 1.0.0
*/
private $account = null;
/**
* Balance.
*
* @var float
* @since 1.0.0
*/
private $balance = null;
/**
* Constructor.
*
* @param int $id Account id
*
* @since 1.0.0
*/
public function __construct(int $id)
{
$this->id = $id;
}
/**
* @return \DateTime
*
* @since 1.0.0
*/
public function getStart()
{
return $this->start;
}
/**
* @param \DateTime $start
*
* @return void
*
* @since 1.0.0
*/
public function setStart($start)
{
$this->start = $start;
}
/**
* @return \DateTime
*
* @since 1.0.0
*/
public function getEnd()
{
return $this->end;
}
/**
* @param \DateTime $end
*
* @return void
*
* @since 1.0.0
*/
public function setEnd($end)
{
$this->end = $end;
}
/**
* @return TimeRangeType
*
* @since 1.0.0
*/
public function getRangetype()
{
return $this->rangetype;
}
/**
* @param TimeRangeType $rangetype
*
* @return void
*
* @since 1.0.0
*/
public function setRangetype($rangetype)
{
$this->rangetype = $rangetype;
}
/**
* @return AccountInterface
*
* @since 1.0.0
*/
public function getAccount()
{
return $this->account;
}
/**
* @param AccountInterface $account
*
* @return void
*
* @since 1.0.0
*/
public function setAccount($account)
{
$this->account = $account;
}
/**
* @return float
*
* @since 1.0.0
*/
public function getBalance()
{
return $this->balance;
}
/**
* @param float $balance
*
* @return void
*
* @since 1.0.0
*/
public function setBalance($balance)
{
$this->balance = $balance;
}
}

View File

@ -1,46 +0,0 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types = 1);
namespace Modules\Accounting\Models;
/**
* Account interface.
*
* @category Module
* @package Accounting
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
interface AccountInterface
{
/**
* Get all groups.
*
* This function gets all groups in a range
*
* @return float
*
* @since 1.0.0
*/
public function getBalance();
/**
* Close out account.
*
* @since 1.0.0
*/
public function closeOut();
}

View File

@ -28,10 +28,7 @@ use phpOMS\Stdlib\Base\Enum;
abstract class AccountType extends Enum abstract class AccountType extends Enum
{ {
/* public */ const IMPERSONAL = 0; /* public */ const IMPERSONAL = 0;
/* public */ const PERSONAL = 1; /* public */ const PERSONAL = 1;
/* public */ const CREDITOR = 2; /* public */ const CREDITOR = 2;
/* public */ const DEBITOR = 4;
/* public */ const DEBITOR = 3;
} }

View File

@ -25,7 +25,7 @@ use phpOMS\Utils\IO\ExchangeInterface;
* @link http://website.orange-management.de * @link http://website.orange-management.de
* @since 1.0.0 * @since 1.0.0
*/ */
abstract class Balance implements ExchangeInterface class Balance
{ {
/** /**
@ -36,30 +36,13 @@ abstract class Balance implements ExchangeInterface
*/ */
private $id = 0; private $id = 0;
/**
* Date of the balance.
*
* @var \Datetime
* @since 1.0.0
*/
private $date = null;
/** /**
* Balance data. * Balance data.
* *
* @var array * @var array
* @since 1.0.0 * @since 1.0.0
*/ */
private $balance = [ private $balance = [];
'credit' => [
'capital' => [],
'circulating' => [],
],
'debit' => [
'equity' => [],
'debt' => [],
],
];
/** /**
* Constructor. * Constructor.
@ -79,72 +62,4 @@ abstract class Balance implements ExchangeInterface
{ {
return $this->id; return $this->id;
} }
/**
* @param int $id
*
* @return void
*
* @since 1.0.0
*/
public function setId($id)
{
$this->id = $id;
}
/**
* {@inheritdoc}
*/
public function exportJson($path)
{
}
/**
* {@inheritdoc}
*/
public function importJson($path)
{
}
/**
* {@inheritdoc}
*/
public function exportCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function importCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function exportExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function importExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function exportPdf($path)
{
}
/**
* {@inheritdoc}
*/
public function importPdf($path)
{
}
} }

View File

@ -14,8 +14,6 @@
declare(strict_types = 1); declare(strict_types = 1);
namespace Modules\Accounting\Models; namespace Modules\Accounting\Models;
use phpOMS\Utils\IO\ExchangeInterface;
/** /**
* BatchPosting class. * BatchPosting class.
* *
@ -25,7 +23,7 @@ use phpOMS\Utils\IO\ExchangeInterface;
* @link http://website.orange-management.de * @link http://website.orange-management.de
* @since 1.0.0 * @since 1.0.0
*/ */
class BatchPosting implements ExchangeInterface, \Countable class BatchPosting implements \Countable
{ {
/** /**
@ -42,7 +40,7 @@ class BatchPosting implements ExchangeInterface, \Countable
* @var int * @var int
* @since 1.0.0 * @since 1.0.0
*/ */
private $creator = null; private $creator = 0;
/** /**
* Created. * Created.
@ -58,7 +56,7 @@ class BatchPosting implements ExchangeInterface, \Countable
* @var string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
private $description = null; private $description = '';
/** /**
* Postings. * Postings.
@ -75,6 +73,7 @@ class BatchPosting implements ExchangeInterface, \Countable
*/ */
public function __construct() public function __construct()
{ {
$this->created = new \DateTime('now');
} }
/** /**
@ -89,20 +88,6 @@ class BatchPosting implements ExchangeInterface, \Countable
return $this->id; return $this->id;
} }
/**
* Set id.
*
* @param int $id Batch ID
*
* @return void
*
* @since 1.0.0
*/
public function setId($id)
{
$this->id = $id;
}
/** /**
* Get description. * Get description.
* *
@ -110,7 +95,7 @@ class BatchPosting implements ExchangeInterface, \Countable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function getDescription() public function getDescription() : string
{ {
return $this->description; return $this->description;
} }
@ -124,8 +109,9 @@ class BatchPosting implements ExchangeInterface, \Countable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function setDescription($desc) public function setDescription(string $desc)
{ {
$this->description = $desc;
} }
/** /**
@ -135,25 +121,11 @@ class BatchPosting implements ExchangeInterface, \Countable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function getCreated() public function getCreatedAt() : \DateTime
{ {
return $this->created; return $this->created;
} }
/**
* Set creator.
*
* @param \Datetime $created Created
*
* @return void
*
* @since 1.0.0
*/
public function setCreated($created)
{
$this->created = $created;
}
/** /**
* Get creator. * Get creator.
* *
@ -230,59 +202,4 @@ class BatchPosting implements ExchangeInterface, \Countable
return count($this->postings); return count($this->postings);
} }
/**
* {@inheritdoc}
*/
public function exportJson($path)
{
}
/**
* {@inheritdoc}
*/
public function importJson($path)
{
}
/**
* {@inheritdoc}
*/
public function exportCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function importCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function exportExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function importExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function exportPdf($path)
{
}
/**
* {@inheritdoc}
*/
public function importPdf($path)
{
}
} }

View File

@ -14,8 +14,6 @@
declare(strict_types = 1); declare(strict_types = 1);
namespace Modules\Accounting\Models; namespace Modules\Accounting\Models;
use phpOMS\Utils\IO\ExchangeInterface;
/** /**
* Creditor class. * Creditor class.
* *
@ -25,7 +23,7 @@ use phpOMS\Utils\IO\ExchangeInterface;
* @link http://website.orange-management.de * @link http://website.orange-management.de
* @since 1.0.0 * @since 1.0.0
*/ */
abstract class Creditor implements ExchangeInterface class Creditor
{ {
/** /**
@ -36,60 +34,4 @@ abstract class Creditor implements ExchangeInterface
public function __construct() public function __construct()
{ {
} }
/**
* {@inheritdoc}
*/
public function exportJson($path)
{
}
/**
* {@inheritdoc}
*/
public function importJson($path)
{
}
/**
* {@inheritdoc}
*/
public function exportCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function importCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function exportExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function importExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function exportPdf($path)
{
}
/**
* {@inheritdoc}
*/
public function importPdf($path)
{
}
} }

View File

@ -14,8 +14,6 @@
declare(strict_types = 1); declare(strict_types = 1);
namespace Modules\Accounting\Models; namespace Modules\Accounting\Models;
use phpOMS\Utils\IO\ExchangeInterface;
/** /**
* Debitor class. * Debitor class.
* *
@ -25,7 +23,7 @@ use phpOMS\Utils\IO\ExchangeInterface;
* @link http://website.orange-management.de * @link http://website.orange-management.de
* @since 1.0.0 * @since 1.0.0
*/ */
abstract class Debitor implements ExchangeInterface class Debitor
{ {
/** /**
@ -37,59 +35,4 @@ abstract class Debitor implements ExchangeInterface
{ {
} }
/**
* {@inheritdoc}
*/
public function exportJson($path)
{
}
/**
* {@inheritdoc}
*/
public function importJson($path)
{
}
/**
* {@inheritdoc}
*/
public function exportCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function importCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function exportExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function importExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function exportPdf($path)
{
}
/**
* {@inheritdoc}
*/
public function importPdf($path)
{
}
} }

View File

@ -25,7 +25,7 @@ use phpOMS\Utils\IO\ExchangeInterface;
* @link http://website.orange-management.de * @link http://website.orange-management.de
* @since 1.0.0 * @since 1.0.0
*/ */
abstract class ImpersonalAccount implements ExchangeInterface class ImpersonalAccount
{ {
/** /**
@ -37,59 +37,4 @@ abstract class ImpersonalAccount implements ExchangeInterface
{ {
} }
/**
* {@inheritdoc}
*/
public function exportJson($path)
{
}
/**
* {@inheritdoc}
*/
public function importJson($path)
{
}
/**
* {@inheritdoc}
*/
public function exportCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function importCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function exportExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function importExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function exportPdf($path)
{
}
/**
* {@inheritdoc}
*/
public function importPdf($path)
{
}
} }

View File

@ -14,8 +14,6 @@
declare(strict_types = 1); declare(strict_types = 1);
namespace Modules\Accounting\Models; namespace Modules\Accounting\Models;
use phpOMS\Utils\IO\ExchangeInterface;
/** /**
* IncomeStatement class. * IncomeStatement class.
* *
@ -25,7 +23,7 @@ use phpOMS\Utils\IO\ExchangeInterface;
* @link http://website.orange-management.de * @link http://website.orange-management.de
* @since 1.0.0 * @since 1.0.0
*/ */
abstract class IncomeStatement implements ExchangeInterface class IncomeStatement
{ {
private $id = 0; private $id = 0;
@ -36,60 +34,4 @@ abstract class IncomeStatement implements ExchangeInterface
public function __construct() public function __construct()
{ {
} }
/**
* {@inheritdoc}
*/
public function exportJson($path)
{
}
/**
* {@inheritdoc}
*/
public function importJson($path)
{
}
/**
* {@inheritdoc}
*/
public function exportCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function importCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function exportExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function importExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function exportPdf($path)
{
}
/**
* {@inheritdoc}
*/
public function importPdf($path)
{
}
} }

View File

@ -14,8 +14,6 @@
declare(strict_types = 1); declare(strict_types = 1);
namespace Modules\Accounting\Models; namespace Modules\Accounting\Models;
/** /**
* Invoice posting class. * Invoice posting class.
* *
@ -25,7 +23,7 @@ namespace Modules\Accounting\Models;
* @link http://website.orange-management.de * @link http://website.orange-management.de
* @since 1.0.0 * @since 1.0.0
*/ */
abstract class InvoicePosting extends PostingAbstract class InvoicePosting extends PostingAbstract
{ {
/** /**
@ -37,59 +35,4 @@ abstract class InvoicePosting extends PostingAbstract
{ {
} }
/**
* {@inheritdoc}
*/
public function exportJson($path)
{
}
/**
* {@inheritdoc}
*/
public function importJson($path)
{
}
/**
* {@inheritdoc}
*/
public function exportCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function importCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function exportExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function importExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function exportPdf($path)
{
}
/**
* {@inheritdoc}
*/
public function importPdf($path)
{
}
} }

View File

@ -14,8 +14,6 @@
declare(strict_types = 1); declare(strict_types = 1);
namespace Modules\Accounting\Models; namespace Modules\Accounting\Models;
/** /**
* Invoice posting simple class. * Invoice posting simple class.
* *
@ -37,59 +35,4 @@ abstract class InvoicePostingSimple extends PostingAbstract
{ {
} }
/**
* {@inheritdoc}
*/
public function exportJson($path)
{
}
/**
* {@inheritdoc}
*/
public function importJson($path)
{
}
/**
* {@inheritdoc}
*/
public function exportCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function importCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function exportExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function importExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function exportPdf($path)
{
}
/**
* {@inheritdoc}
*/
public function importPdf($path)
{
}
} }

View File

@ -14,8 +14,6 @@
declare(strict_types = 1); declare(strict_types = 1);
namespace Modules\Accounting\Models; namespace Modules\Accounting\Models;
use phpOMS\Utils\IO\ExchangeInterface;
/** /**
* ImpersonalAccount class. * ImpersonalAccount class.
* *
@ -25,7 +23,7 @@ use phpOMS\Utils\IO\ExchangeInterface;
* @link http://website.orange-management.de * @link http://website.orange-management.de
* @since 1.0.0 * @since 1.0.0
*/ */
abstract class PersonalAccountAbstract extends AccountAbstract implements ExchangeInterface abstract class PersonalAccountAbstract extends AccountAbstract
{ {
public function __construct(int $id) public function __construct(int $id)
{ {
@ -48,59 +46,4 @@ abstract class PersonalAccountAbstract extends AccountAbstract implements Exchan
{ {
} }
/**
* {@inheritdoc}
*/
public function exportJson($path)
{
}
/**
* {@inheritdoc}
*/
public function importJson($path)
{
}
/**
* {@inheritdoc}
*/
public function exportCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function importCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function exportExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function importExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function exportPdf($path)
{
}
/**
* {@inheritdoc}
*/
public function importPdf($path)
{
}
} }

View File

@ -14,8 +14,6 @@
declare(strict_types = 1); declare(strict_types = 1);
namespace Modules\Accounting\Models; namespace Modules\Accounting\Models;
/** /**
* Posting class. * Posting class.
* *
@ -37,59 +35,4 @@ abstract class Posting extends PostingAbstract
{ {
} }
/**
* {@inheritdoc}
*/
public function exportJson($path)
{
}
/**
* {@inheritdoc}
*/
public function importJson($path)
{
}
/**
* {@inheritdoc}
*/
public function exportCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function importCsv($path)
{
}
/**
* {@inheritdoc}
*/
public function exportExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function importExcel($path)
{
}
/**
* {@inheritdoc}
*/
public function exportPdf($path)
{
}
/**
* {@inheritdoc}
*/
public function importPdf($path)
{
}
} }

View File

@ -14,8 +14,6 @@
declare(strict_types = 1); declare(strict_types = 1);
namespace Modules\Accounting\Models; namespace Modules\Accounting\Models;
/** /**
* Posting abstract class. * Posting abstract class.
* *

View File

@ -14,8 +14,6 @@
declare(strict_types = 1); declare(strict_types = 1);
namespace Modules\Accounting\Models; namespace Modules\Accounting\Models;
use phpOMS\Utils\IO\ExchangeInterface;
/** /**
* Posting interface. * Posting interface.
* *
@ -25,6 +23,6 @@ use phpOMS\Utils\IO\ExchangeInterface;
* @link http://website.orange-management.de * @link http://website.orange-management.de
* @since 1.0.0 * @since 1.0.0
*/ */
interface PostingInterface extends ExchangeInterface interface PostingInterface
{ {
} }