mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 01:38:41 +00:00
php cs fixer
This commit is contained in:
parent
9a09993336
commit
a80224b07d
|
|
@ -753,7 +753,7 @@ class Builder extends BuilderAbstract
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function lock()
|
||||
public function lock() : void
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -764,7 +764,7 @@ class Builder extends BuilderAbstract
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function lockUpdate()
|
||||
public function lockUpdate() : void
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -787,7 +787,7 @@ class Builder extends BuilderAbstract
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function find()
|
||||
public function find() : void
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -813,7 +813,7 @@ class Builder extends BuilderAbstract
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function min()
|
||||
public function min() : void
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -824,7 +824,7 @@ class Builder extends BuilderAbstract
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function max()
|
||||
public function max() : void
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -835,7 +835,7 @@ class Builder extends BuilderAbstract
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function sum()
|
||||
public function sum() : void
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -846,7 +846,7 @@ class Builder extends BuilderAbstract
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function avg()
|
||||
public function avg() : void
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -1032,7 +1032,7 @@ class Builder extends BuilderAbstract
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function increment()
|
||||
public function increment() : void
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -1043,7 +1043,7 @@ class Builder extends BuilderAbstract
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function decrement()
|
||||
public function decrement() : void
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class Builder extends QueryBuilder
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function alter(array $column)
|
||||
public function alter(array $column) : void
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ final class EventManager implements \Countable
|
|||
public function __construct(Dispatcher $dispatcher = null)
|
||||
{
|
||||
$this->dispatcher = $dispatcher ?? new class {
|
||||
public function dispatch($func, ...$data)
|
||||
public function dispatch($func, ...$data) : void
|
||||
{
|
||||
$func(...$data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -732,7 +732,7 @@ class Matrix implements \ArrayAccess, \Iterator
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function next()
|
||||
public function next() : void
|
||||
{
|
||||
++$this->position;
|
||||
}
|
||||
|
|
@ -766,7 +766,7 @@ class Matrix implements \ArrayAccess, \Iterator
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function rewind()
|
||||
public function rewind() : void
|
||||
{
|
||||
$this->position = 0;
|
||||
}
|
||||
|
|
@ -774,7 +774,7 @@ class Matrix implements \ArrayAccess, \Iterator
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function offsetSet($offset, $value)
|
||||
public function offsetSet($offset, $value) : void
|
||||
{
|
||||
$row = (int) ($offset / $this->m);
|
||||
$this->matrix[$row][$offset - $row * $this->n] = $value;
|
||||
|
|
@ -783,7 +783,7 @@ class Matrix implements \ArrayAccess, \Iterator
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function offsetUnset($offset)
|
||||
public function offsetUnset($offset) : void
|
||||
{
|
||||
$row = (int) ($offset / $this->m);
|
||||
unset($this->matrix[$row][$offset - $row * $this->n]);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use phpOMS\Math\Matrix\Matrix;
|
|||
class MultipleLinearRegression
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
*/
|
||||
public static function getRegression(array $x, array $y) : array
|
||||
{
|
||||
|
|
@ -33,21 +33,21 @@ class MultipleLinearRegression
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
*/
|
||||
public static function getVariance() : float
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
*/
|
||||
public static function getPredictionInterval() : array
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
*/
|
||||
public static function getSlope(float $b1, float $y, float $x) : float
|
||||
{
|
||||
|
|
@ -55,7 +55,7 @@ class MultipleLinearRegression
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
*/
|
||||
public static function getElasticity(float $b1, float $y, float $x): float
|
||||
{
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ final class MeasureOfDispersion
|
|||
*
|
||||
* @return float
|
||||
*
|
||||
* @throws ZeroDevisionException This exception is thrown if the size of the x array is less than 2
|
||||
* @throws ZeroDevisionException This exception is thrown if the size of the x array is less than 2
|
||||
* @throws InvalidDimensionException This exception is thrown if x and y have different dimensions
|
||||
*
|
||||
* @since 1.0.0
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ interface UploadedFileInterface
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function moveTo(string $targetPath);
|
||||
public function moveTo(string $targetPath) : void;
|
||||
|
||||
/**
|
||||
* Retrieve the file size.
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ class Dom implements \Serializable, ArrayableInterface
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function unserialize($raw)
|
||||
public function unserialize($raw) : void
|
||||
{
|
||||
$unserialized = \json_decode($raw, true);
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ class FormValidation implements \Serializable, ArrayableInterface, \JsonSerializ
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function unserialize($raw)
|
||||
public function unserialize($raw) : void
|
||||
{
|
||||
$unserialized = \json_decode($raw, true);
|
||||
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ class Notify implements \Serializable, ArrayableInterface, \JsonSerializable
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function unserialize($raw)
|
||||
public function unserialize($raw) : void
|
||||
{
|
||||
$unserialized = \json_decode($raw, true);
|
||||
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ class Redirect implements \Serializable, ArrayableInterface, \JsonSerializable
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function unserialize($raw)
|
||||
public function unserialize($raw) : void
|
||||
{
|
||||
$unserialized = \json_decode($raw, true);
|
||||
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ class Reload implements \Serializable, ArrayableInterface, \JsonSerializable
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function unserialize($raw)
|
||||
public function unserialize($raw) : void
|
||||
{
|
||||
$unserialized = \json_decode($raw, true);
|
||||
|
||||
|
|
|
|||
|
|
@ -32,5 +32,5 @@ interface ConsoleInterface
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function callConsole();
|
||||
public function callConsole() : void;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,5 +32,5 @@ interface SocketInterface
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function callSock();
|
||||
public function callSock() : void;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class Client extends SocketAbstract
|
|||
$this->commands = new CommandManager();
|
||||
|
||||
/** @noinspection PhpUnusedParameterInspection */
|
||||
$this->commands->attach('disconnect', function ($conn, $para) {
|
||||
$this->commands->attach('disconnect', function ($conn, $para) : void {
|
||||
$this->disconnect();
|
||||
}, $this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ class Header implements \Serializable
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function unserialize($string)
|
||||
public function unserialize($string) : void
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ abstract class PacketAbstract implements \Serializable
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
abstract public function unserialize($string);
|
||||
abstract public function unserialize($string) : void;
|
||||
|
||||
/**
|
||||
* Get packet header.
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class ClientManager
|
|||
{
|
||||
private $clients = [];
|
||||
|
||||
public function add(ClientConnection $client)
|
||||
public function add(ClientConnection $client) : void
|
||||
{
|
||||
$this->clients[$client->getId()] = $client;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ class Iban implements \Serializable
|
|||
* @return void
|
||||
* @since 5.1.0
|
||||
*/
|
||||
public function unserialize($serialized)
|
||||
public function unserialize($serialized) : void
|
||||
{
|
||||
$this->parse($serialized);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -332,7 +332,7 @@ class Location implements \JsonSerializable, \Serializable
|
|||
* @return void
|
||||
* @since 5.1.0
|
||||
*/
|
||||
public function unserialize($serialized)
|
||||
public function unserialize($serialized) : void
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ class Tree extends Graph
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function levelOrder(Node $node, \Closure $callback)
|
||||
public function levelOrder(Node $node, \Closure $callback) : void
|
||||
{
|
||||
$depth = $this->getMaxDepth();
|
||||
|
||||
|
|
|
|||
|
|
@ -323,7 +323,7 @@ class PriorityQueue implements \Countable, \Serializable
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function unserialize($data)
|
||||
public function unserialize($data) : void
|
||||
{
|
||||
$this->queue = \json_decode($data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class Directory extends FileAbstract implements DirectoryInterface
|
|||
return \in_array(LocalFile::name($path), $list);
|
||||
}
|
||||
|
||||
public static function ftpCreate($con, string $path, int $permission, bool $recursive)
|
||||
public static function ftpCreate($con, string $path, int $permission, bool $recursive) : void
|
||||
{
|
||||
$parts = \explode('/', $path);
|
||||
\ftp_chdir($con, '/' . $parts[0]);
|
||||
|
|
@ -272,7 +272,7 @@ class Directory extends FileAbstract implements DirectoryInterface
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function rewind()
|
||||
public function rewind() : void
|
||||
{
|
||||
\reset($this->nodes);
|
||||
}
|
||||
|
|
@ -314,7 +314,7 @@ class Directory extends FileAbstract implements DirectoryInterface
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function offsetSet($offset, $value)
|
||||
public function offsetSet($offset, $value) : void
|
||||
{
|
||||
if ($offset === null) {
|
||||
$this->addNode($value);
|
||||
|
|
@ -334,7 +334,7 @@ class Directory extends FileAbstract implements DirectoryInterface
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function offsetUnset($offset)
|
||||
public function offsetUnset($offset) : void
|
||||
{
|
||||
if (isset($this->nodes[$offset])) {
|
||||
unset($this->nodes[$offset]);
|
||||
|
|
|
|||
|
|
@ -457,7 +457,7 @@ final class Directory extends FileAbstract implements DirectoryInterface
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function rewind()
|
||||
public function rewind() : void
|
||||
{
|
||||
\reset($this->nodes);
|
||||
}
|
||||
|
|
@ -499,7 +499,7 @@ final class Directory extends FileAbstract implements DirectoryInterface
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function offsetSet($offset, $value)
|
||||
public function offsetSet($offset, $value) : void
|
||||
{
|
||||
if ($offset === null) {
|
||||
$this->addNode($value);
|
||||
|
|
@ -519,7 +519,7 @@ final class Directory extends FileAbstract implements DirectoryInterface
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function offsetUnset($offset)
|
||||
public function offsetUnset($offset) : void
|
||||
{
|
||||
if (isset($this->nodes[$offset])) {
|
||||
unset($this->nodes[$offset]);
|
||||
|
|
@ -595,7 +595,7 @@ final class Directory extends FileAbstract implements DirectoryInterface
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function offsetGet($offset)
|
||||
public function offsetGet($offset) : void
|
||||
{
|
||||
// TODO: Implement offsetGet() method.
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class ExcelDatabaseMapper implements IODatabaseMapper
|
|||
|
||||
private $lineBuffer = 500;
|
||||
|
||||
public function addSource(string $source)
|
||||
public function addSource(string $source) : void
|
||||
{
|
||||
$this->sources[] = $source;
|
||||
}
|
||||
|
|
@ -37,7 +37,7 @@ class ExcelDatabaseMapper implements IODatabaseMapper
|
|||
$this->sources = $sources;
|
||||
}
|
||||
|
||||
public function insert()
|
||||
public function insert() : void
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ interface ExcelInterface
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function exportExcel($path);
|
||||
public function exportExcel($path) : void;
|
||||
|
||||
/**
|
||||
* Import Excel.
|
||||
|
|
@ -45,5 +45,5 @@ interface ExcelInterface
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function importExcel($path);
|
||||
public function importExcel($path) : void;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ interface JsonInterface
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function exportJson($path);
|
||||
public function exportJson($path) : void;
|
||||
|
||||
/**
|
||||
* Import Json.
|
||||
|
|
@ -45,5 +45,5 @@ interface JsonInterface
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function importJson($path);
|
||||
public function importJson($path) : void;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,5 +34,5 @@ interface PdfInterface
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function exportPdf($path);
|
||||
public function exportPdf($path) : void;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ final class JsonBuilder implements \Serializable, \JsonSerializable
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function unserialize($serialized)
|
||||
public function unserialize($serialized) : void
|
||||
{
|
||||
$this->json = \json_decode($serialized, true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ final class Permutation
|
|||
* @return mixed
|
||||
*
|
||||
* @throws \InvalidArgumentException This exception is thrown if the $toPermute argument is neither array or string
|
||||
* @throws \OutOfBoundsException This exception is thrown if the permutation key is larger than the data to permute
|
||||
* @throws \OutOfBoundsException This exception is thrown if the permutation key is larger than the data to permute
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ class Interval implements \Serializable
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function unserialize($serialized)
|
||||
public function unserialize($serialized) : void
|
||||
{
|
||||
$elements = \explode(' ', \trim($serialized));
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ class PaginationView extends View
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function setMaxPages(int $maxPages)
|
||||
public function setMaxPages(int $maxPages) : void
|
||||
{
|
||||
$this->maxPages = $maxPages;
|
||||
}
|
||||
|
|
@ -94,7 +94,7 @@ class PaginationView extends View
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function setPages(int $pages)
|
||||
public function setPages(int $pages) : void
|
||||
{
|
||||
$this->pages = $pages;
|
||||
}
|
||||
|
|
@ -116,7 +116,7 @@ class PaginationView extends View
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function setPage(int $page = 1)
|
||||
public function setPage(int $page = 1) : void
|
||||
{
|
||||
$this->page = $page;
|
||||
}
|
||||
|
|
@ -138,7 +138,7 @@ class PaginationView extends View
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function setResults(int $results = 0)
|
||||
public function setResults(int $results = 0) : void
|
||||
{
|
||||
$this->results = $results;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -275,7 +275,7 @@ abstract class ViewAbstract implements \Serializable
|
|||
* @since 1.0.0
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function unserialize($raw)
|
||||
public function unserialize($raw) : void
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ require_once __DIR__ . '/../Autoloader.php';
|
|||
class AccountManagerTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
|
||||
public function testAttributes()
|
||||
public function testAttributes() : void
|
||||
{
|
||||
$manager = new AccountManager($GLOBALS['httpSession']);
|
||||
self::assertInstanceOf('\phpOMS\Account\AccountManager', $manager);
|
||||
|
|
@ -30,7 +30,7 @@ class AccountManagerTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertObjectHasAttribute('accounts', $manager);
|
||||
}
|
||||
|
||||
public function testDefault()
|
||||
public function testDefault() : void
|
||||
{
|
||||
$manager = new AccountManager($GLOBALS['httpSession']);
|
||||
|
||||
|
|
@ -39,7 +39,7 @@ class AccountManagerTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertInstanceOf('\phpOMS\Account\NullAccount', $manager->get(-1));
|
||||
}
|
||||
|
||||
public function testSetGet()
|
||||
public function testSetGet() : void
|
||||
{
|
||||
$manager = new AccountManager($GLOBALS['httpSession']);
|
||||
$account = new Account(3);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ use phpOMS\Account\AccountStatus;
|
|||
|
||||
class AccountStatusTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testEnums()
|
||||
public function testEnums() : void
|
||||
{
|
||||
self::assertEquals(4, \count(AccountStatus::getConstants()));
|
||||
self::assertEquals(1, AccountStatus::ACTIVE);
|
||||
|
|
|
|||
|
|
@ -28,12 +28,12 @@ class AccountTest extends \PHPUnit\Framework\TestCase
|
|||
{
|
||||
protected $l11nManager = null;
|
||||
|
||||
protected function setUp()
|
||||
protected function setUp() : void
|
||||
{
|
||||
$this->l11nManager = new L11nManager('Api');
|
||||
}
|
||||
|
||||
public function testAttributes()
|
||||
public function testAttributes() : void
|
||||
{
|
||||
$account = new Account();
|
||||
self::assertInstanceOf('\phpOMS\Account\Account', $account);
|
||||
|
|
@ -55,7 +55,7 @@ class AccountTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertObjectHasAttribute('l11n', $account);
|
||||
}
|
||||
|
||||
public function testDefault()
|
||||
public function testDefault() : void
|
||||
{
|
||||
$account = new Account();
|
||||
|
||||
|
|
@ -99,7 +99,7 @@ class AccountTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals($array, $account->jsonSerialize());
|
||||
}
|
||||
|
||||
public function testSetGet()
|
||||
public function testSetGet() : void
|
||||
{
|
||||
$account = new Account();
|
||||
|
||||
|
|
@ -168,7 +168,7 @@ class AccountTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
*/
|
||||
public function testEmailException()
|
||||
public function testEmailException() : void
|
||||
{
|
||||
$account = new Account();
|
||||
$account->setEmail('d.duck!@#%@duckburg');
|
||||
|
|
@ -177,7 +177,7 @@ class AccountTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\Stdlib\Base\Exception\InvalidEnumValue
|
||||
*/
|
||||
public function testStatusException()
|
||||
public function testStatusException() : void
|
||||
{
|
||||
$account = new Account();
|
||||
$account->setStatus(99);
|
||||
|
|
@ -186,7 +186,7 @@ class AccountTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\Stdlib\Base\Exception\InvalidEnumValue
|
||||
*/
|
||||
public function testTypeException()
|
||||
public function testTypeException() : void
|
||||
{
|
||||
$account = new Account();
|
||||
$account->setType(99);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ use phpOMS\Account\AccountType;
|
|||
|
||||
class AccountTypeTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testEnums()
|
||||
public function testEnums() : void
|
||||
{
|
||||
self::assertEquals(2, \count(AccountType::getConstants()));
|
||||
self::assertEquals(0, AccountType::USER);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ use phpOMS\Account\GroupStatus;
|
|||
|
||||
class GroupStatusTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testEnums()
|
||||
public function testEnums() : void
|
||||
{
|
||||
self::assertEquals(3, \count(GroupStatus::getConstants()));
|
||||
self::assertEquals(1, GroupStatus::ACTIVE);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ require_once __DIR__ . '/../Autoloader.php';
|
|||
|
||||
class GroupTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testAttributes()
|
||||
public function testAttributes() : void
|
||||
{
|
||||
$group = new Group();
|
||||
self::assertInstanceOf('\phpOMS\Account\Group', $group);
|
||||
|
|
@ -35,7 +35,7 @@ class GroupTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertObjectHasAttribute('status', $group);
|
||||
}
|
||||
|
||||
public function testDefault()
|
||||
public function testDefault() : void
|
||||
{
|
||||
$group = new Group();
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ class GroupTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals($array, $group->jsonSerialize());
|
||||
}
|
||||
|
||||
public function testSetGet()
|
||||
public function testSetGet() : void
|
||||
{
|
||||
$group = new Group();
|
||||
|
||||
|
|
@ -76,7 +76,7 @@ class GroupTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\Stdlib\Base\Exception\InvalidEnumValue
|
||||
*/
|
||||
public function testStatusException()
|
||||
public function testStatusException() : void
|
||||
{
|
||||
$account = new Group();
|
||||
$account->setStatus(99);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ use phpOMS\Account\NullAccount;
|
|||
|
||||
class NullAccountTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testNull()
|
||||
public function testNull() : void
|
||||
{
|
||||
self::assertInstanceOf('\phpOMS\Account\Account', new NullAccount());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ use phpOMS\Account\PermissionType;
|
|||
|
||||
class PermissionAbstractTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testAbstractDefault()
|
||||
public function testAbstractDefault() : void
|
||||
{
|
||||
$perm = new class extends PermissionAbstract {};
|
||||
|
||||
|
|
@ -50,7 +50,7 @@ class PermissionAbstractTest extends \PHPUnit\Framework\TestCase
|
|||
);
|
||||
}
|
||||
|
||||
public function testAbstractGetSet()
|
||||
public function testAbstractGetSet() : void
|
||||
{
|
||||
$perm = new class extends PermissionAbstract {};
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ use phpOMS\Account\PermissionType;
|
|||
|
||||
class PermissionTypeTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testEnums()
|
||||
public function testEnums() : void
|
||||
{
|
||||
self::assertEquals(6, \count(PermissionType::getConstants()));
|
||||
self::assertEquals(PermissionType::getConstants(), array_unique(PermissionType::getConstants()));
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use phpOMS\ApplicationAbstract;
|
|||
|
||||
class ApplicationAbstractTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testGetSet()
|
||||
public function testGetSet() : void
|
||||
{
|
||||
$obj = new class extends ApplicationAbstract {};
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ require_once __DIR__ . '/../Autoloader.php';
|
|||
|
||||
class AssetManagerTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testAttributes()
|
||||
public function testAttributes() : void
|
||||
{
|
||||
$manager = new AssetManager();
|
||||
self::assertInstanceOf('\phpOMS\Asset\AssetManager', $manager);
|
||||
|
|
@ -28,7 +28,7 @@ class AssetManagerTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertObjectHasAttribute('assets', $manager);
|
||||
}
|
||||
|
||||
public function testDefault()
|
||||
public function testDefault() : void
|
||||
{
|
||||
$manager = new AssetManager();
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ class AssetManagerTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(0, $manager->count());
|
||||
}
|
||||
|
||||
public function testSetGet()
|
||||
public function testSetGet() : void
|
||||
{
|
||||
$manager = new AssetManager();
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ use phpOMS\Asset\AssetType;
|
|||
|
||||
class AssetTypeTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testEnums()
|
||||
public function testEnums() : void
|
||||
{
|
||||
self::assertEquals(3, \count(AssetType::getConstants()));
|
||||
self::assertEquals(0, AssetType::CSS);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ require_once __DIR__ . '/../Autoloader.php';
|
|||
|
||||
class AuthTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testWithHttpSession()
|
||||
public function testWithHttpSession() : void
|
||||
{
|
||||
self::assertEquals(0, Auth::authenticate($GLOBALS['httpSession']));
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ use phpOMS\Auth\LoginReturnType;
|
|||
|
||||
class LoginReturnTypeTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testEnums()
|
||||
public function testEnums() : void
|
||||
{
|
||||
self::assertEquals(11, \count(LoginReturnType::getConstants()));
|
||||
self::assertEquals(0, LoginReturnType::OK);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use phpOMS\AutoloadException;
|
|||
|
||||
class AutoloadExceptionTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testException()
|
||||
public function testException() : void
|
||||
{
|
||||
self::assertInstanceOf(\RuntimeException::class, new AutoloadException(''));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use phpOMS\Autoloader;
|
|||
|
||||
class AutoloaderTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testAutoloader()
|
||||
public function testAutoloader() : void
|
||||
{
|
||||
self::assertTrue(Autoloader::exists('\phpOMS\Autoloader'));
|
||||
self::assertFalse(Autoloader::exists('\Does\Not\Exist'));
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use phpOMS\Business\Finance\Depreciation;
|
|||
|
||||
class DepreciationTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testStraightLine()
|
||||
public function testStraightLine() : void
|
||||
{
|
||||
$start = 23280;
|
||||
$duration = 6;
|
||||
|
|
@ -27,7 +27,7 @@ class DepreciationTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(23280 - 3880 * $t, Depreciation::getStraightLineResidualInT($start, $duration, $t), '', 5);
|
||||
}
|
||||
|
||||
public function testArithmeticDegressivDepreciation()
|
||||
public function testArithmeticDegressivDepreciation() : void
|
||||
{
|
||||
$start = 150000;
|
||||
$residual = 18000;
|
||||
|
|
@ -39,7 +39,7 @@ class DepreciationTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(70800, Depreciation::getArithmeticDegressivDepreciationResidualInT($start, $residual, $duration, $t), '', 5);
|
||||
}
|
||||
|
||||
public function testArithmeticProgressivDepreciation()
|
||||
public function testArithmeticProgressivDepreciation() : void
|
||||
{
|
||||
$start = 40000;
|
||||
$residual = 4700;
|
||||
|
|
@ -51,7 +51,7 @@ class DepreciationTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(29410, Depreciation::getArithmeticProgressivDepreciationResidualInT($start, $residual, $duration, $t), '', 5);
|
||||
}
|
||||
|
||||
public function testGeometicProgressivDepreciation()
|
||||
public function testGeometicProgressivDepreciation() : void
|
||||
{
|
||||
$start = 150000;
|
||||
$residual = 18000;
|
||||
|
|
@ -63,7 +63,7 @@ class DepreciationTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(125965, Depreciation::getGeometicProgressivDepreciationResidualInT($start, $residual, $duration, $t), '', 5);
|
||||
}
|
||||
|
||||
public function testGeometicDegressivDepreciation()
|
||||
public function testGeometicDegressivDepreciation() : void
|
||||
{
|
||||
$start = 150000;
|
||||
$residual = 18000;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use phpOMS\Business\Finance\FinanceFormulas;
|
|||
|
||||
class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testAnnualPercentageYield()
|
||||
public function testAnnualPercentageYield() : void
|
||||
{
|
||||
$expected = 0.06168;
|
||||
|
||||
|
|
@ -29,7 +29,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(round($r, 2), FinanceFormulas::getStateAnnualInterestRateOfAPY($apy, $n));
|
||||
}
|
||||
|
||||
public function testFutureValueOfAnnuity()
|
||||
public function testFutureValueOfAnnuity() : void
|
||||
{
|
||||
$expected = 5204.04;
|
||||
|
||||
|
|
@ -43,7 +43,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(round($P, 2), \round(FinanceFormulas::getPeriodicPaymentOfFVA($fva, $r, $n), 2));
|
||||
}
|
||||
|
||||
public function testFutureValueOfAnnuityContinuousCompounding()
|
||||
public function testFutureValueOfAnnuityContinuousCompounding() : void
|
||||
{
|
||||
$expected = 12336.42;
|
||||
|
||||
|
|
@ -57,7 +57,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals($t, FinanceFormulas::getTimeOfFVACC($fvacc, $cf, $r));
|
||||
}
|
||||
|
||||
public function testAnnuityPaymentPV()
|
||||
public function testAnnuityPaymentPV() : void
|
||||
{
|
||||
$expected = 212.16;
|
||||
|
||||
|
|
@ -71,7 +71,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(round($pv, 2), \round(FinanceFormulas::getPresentValueOfAPPV($p, $r, $n), 2));
|
||||
}
|
||||
|
||||
public function testAnnuityPaymentFV()
|
||||
public function testAnnuityPaymentFV() : void
|
||||
{
|
||||
$expected = 192.16;
|
||||
|
||||
|
|
@ -85,7 +85,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(round($fv, 2), \round(FinanceFormulas::getFutureValueOfAPFV($p, $r, $n), 2));
|
||||
}
|
||||
|
||||
public function testAnnutiyPaymentFactorPV()
|
||||
public function testAnnutiyPaymentFactorPV() : void
|
||||
{
|
||||
$expected = 0.21216;
|
||||
|
||||
|
|
@ -97,7 +97,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals($n, FinanceFormulas::getNumberOfAPFPV($p, $r));
|
||||
}
|
||||
|
||||
public function testPresentValueOfAnnuity()
|
||||
public function testPresentValueOfAnnuity() : void
|
||||
{
|
||||
$expected = 4713.46;
|
||||
|
||||
|
|
@ -111,7 +111,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(round($P, 2), \round(FinanceFormulas::getPeriodicPaymentOfPVA($pva, $r, $n), 2));
|
||||
}
|
||||
|
||||
public function testPresentValueAnnuityFactor()
|
||||
public function testPresentValueAnnuityFactor() : void
|
||||
{
|
||||
$expected = 4.7135;
|
||||
|
||||
|
|
@ -123,7 +123,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals($n, FinanceFormulas::getPeriodsOfPVAF($p, $r));
|
||||
}
|
||||
|
||||
public function testPresentValueOfAnnuityDue()
|
||||
public function testPresentValueOfAnnuityDue() : void
|
||||
{
|
||||
$expected = 454.60;
|
||||
|
||||
|
|
@ -138,7 +138,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals($n, FinanceFormulas::getPeriodsOfPVAD($PV, $P, $r));
|
||||
}
|
||||
|
||||
public function testFutureValueOfAnnuityDue()
|
||||
public function testFutureValueOfAnnuityDue() : void
|
||||
{
|
||||
$expected = 580.19;
|
||||
|
||||
|
|
@ -153,7 +153,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals($n, FinanceFormulas::getPeriodsOfFVAD($FV, $P, $r));
|
||||
}
|
||||
|
||||
public function testRatios()
|
||||
public function testRatios() : void
|
||||
{
|
||||
self::assertEquals(300 / 400, FinanceFormulas::getRelativeMarketShareByShare(300, 400));
|
||||
self::assertEquals(300 / 400, FinanceFormulas::getRelativeMarketShareBySales(300, 400));
|
||||
|
|
@ -188,7 +188,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(100 / 0.15, FinanceFormulas::getPresentValueOfPerpetuity(100, 0.15));
|
||||
}
|
||||
|
||||
public function testCompound()
|
||||
public function testCompound() : void
|
||||
{
|
||||
$expected = 15.76;
|
||||
|
||||
|
|
@ -203,7 +203,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals($t, (int) \round(FinanceFormulas::getPeriodsOfCompundInterest($P, $C, $r), 0));
|
||||
}
|
||||
|
||||
public function testContinuousCompounding()
|
||||
public function testContinuousCompounding() : void
|
||||
{
|
||||
$expected = 116.18;
|
||||
|
||||
|
|
@ -219,7 +219,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertTrue(\abs($r - FinanceFormulas::getRateOfContinuousCompounding($P, $C, $t)) < 0.01);
|
||||
}
|
||||
|
||||
public function testSimpleInterest()
|
||||
public function testSimpleInterest() : void
|
||||
{
|
||||
$P = 100.00;
|
||||
$r = 0.05;
|
||||
|
|
@ -233,7 +233,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals($t, FinanceFormulas::getSimpleInterestTime($I, $P, $r));
|
||||
}
|
||||
|
||||
public function testDiscountedPaybackPeriod()
|
||||
public function testDiscountedPaybackPeriod() : void
|
||||
{
|
||||
$O1 = 5000;
|
||||
$r = 0.05;
|
||||
|
|
@ -242,7 +242,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertTrue(\abs(5.896 - FinanceFormulas::getDiscountedPaybackPeriod($CF, $O1, $r)) < 0.01);
|
||||
}
|
||||
|
||||
public function testDoublingTime()
|
||||
public function testDoublingTime() : void
|
||||
{
|
||||
$r = 0.05;
|
||||
|
||||
|
|
@ -250,14 +250,14 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertTrue(\abs($r - FinanceFormulas::getDoublingRate(14.207)) < 0.01);
|
||||
}
|
||||
|
||||
public function testDoublingTimeContinuousCompounding()
|
||||
public function testDoublingTimeContinuousCompounding() : void
|
||||
{
|
||||
$r = 0.05;
|
||||
|
||||
self::assertEquals(13.863, FinanceFormulas::getDoublingTimeContinuousCompounding($r), '', 0.01);
|
||||
}
|
||||
|
||||
public function testEquivalentAnnualAnnuity()
|
||||
public function testEquivalentAnnualAnnuity() : void
|
||||
{
|
||||
$npv = 1000;
|
||||
$r = 0.15;
|
||||
|
|
@ -268,7 +268,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals($npv, FinanceFormulas::getNetPresentValueOfEAA(240.36, $r, $n), '', 0.01);
|
||||
}
|
||||
|
||||
public function testFreeCashFlowToEquity()
|
||||
public function testFreeCashFlowToEquity() : void
|
||||
{
|
||||
$income = 1000;
|
||||
$depamo = 300;
|
||||
|
|
@ -279,7 +279,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(1200, FinanceFormulas::getFreeCashFlowToEquity($income, $depamo, $capital, $wc, $borrowing), '', 0.01);
|
||||
}
|
||||
|
||||
public function testFreeCashFlowToFirm()
|
||||
public function testFreeCashFlowToFirm() : void
|
||||
{
|
||||
$ebit = 1000;
|
||||
$depamo = 300;
|
||||
|
|
@ -290,7 +290,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(550, FinanceFormulas::getFreeCashFlowToFirm($ebit, $t, $depamo, $capital, $wc), '', 0.01);
|
||||
}
|
||||
|
||||
public function testFutureValue()
|
||||
public function testFutureValue() : void
|
||||
{
|
||||
$c = 1000;
|
||||
$r = 0.15;
|
||||
|
|
@ -299,7 +299,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(2660.02, FinanceFormulas::getFutureValue($c, $r, $n), '', 0.01);
|
||||
}
|
||||
|
||||
public function testFutureValueContinuousCompounding()
|
||||
public function testFutureValueContinuousCompounding() : void
|
||||
{
|
||||
$pv = 1000;
|
||||
$r = 0.15;
|
||||
|
|
@ -308,7 +308,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(2857.65, FinanceFormulas::getFutureValueContinuousCompounding($pv, $r, $t), '', 0.01);
|
||||
}
|
||||
|
||||
public function testValueFactor()
|
||||
public function testValueFactor() : void
|
||||
{
|
||||
$r = 0.15;
|
||||
$n = 7;
|
||||
|
|
@ -317,14 +317,14 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(0.37594, FinanceFormulas::getPresentValueFactor($r, $n), '', 0.01);
|
||||
}
|
||||
|
||||
public function testGeometricMeanReturn()
|
||||
public function testGeometricMeanReturn() : void
|
||||
{
|
||||
$r = [0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07];
|
||||
|
||||
self::assertEquals(0.04123, FinanceFormulas::getGeometricMeanReturn($r), '', 0.01);
|
||||
}
|
||||
|
||||
public function testGrowingAnnuityFV()
|
||||
public function testGrowingAnnuityFV() : void
|
||||
{
|
||||
$p = 1000;
|
||||
$r = 0.15;
|
||||
|
|
@ -334,7 +334,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(14226.06, FinanceFormulas::getGrowingAnnuityFV($p, $r, $g, $n), '', 0.01);
|
||||
}
|
||||
|
||||
public function testGrowingAnnuityPaymentPV()
|
||||
public function testGrowingAnnuityPaymentPV() : void
|
||||
{
|
||||
$p = 1000;
|
||||
$r = 0.15;
|
||||
|
|
@ -344,7 +344,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(186.98, FinanceFormulas::getGrowingAnnuityPaymentPV($p, $r, $g, $n), '', 0.01);
|
||||
}
|
||||
|
||||
public function testGrowingAnnuityPaymentFV()
|
||||
public function testGrowingAnnuityPaymentFV() : void
|
||||
{
|
||||
$fv = 1000;
|
||||
$r = 0.15;
|
||||
|
|
@ -354,7 +354,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(70.29, FinanceFormulas::getGrowingAnnuityPaymentFV($fv, $r, $g, $n), '', 0.01);
|
||||
}
|
||||
|
||||
public function testGrowingAnnuityPV()
|
||||
public function testGrowingAnnuityPV() : void
|
||||
{
|
||||
$p = 1000;
|
||||
$r = 0.15;
|
||||
|
|
@ -364,7 +364,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(5348.1, FinanceFormulas::getGrowingAnnuityPV($p, $r, $g, $n), '', 0.01);
|
||||
}
|
||||
|
||||
public function testGrowingPerpetuityPV()
|
||||
public function testGrowingPerpetuityPV() : void
|
||||
{
|
||||
$d = 1000;
|
||||
$r = 0.15;
|
||||
|
|
@ -373,7 +373,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(20000, FinanceFormulas::getGrowingPerpetuityPV($d, $r, $g), '', 0.01);
|
||||
}
|
||||
|
||||
public function testNetPresentValue()
|
||||
public function testNetPresentValue() : void
|
||||
{
|
||||
$c = [1000, 100, 200, 300, 400, 500, 600];
|
||||
$r = 0.15;
|
||||
|
|
@ -384,12 +384,12 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \UnexpectedValueException
|
||||
*/
|
||||
public function testInvalidNetPresentValue()
|
||||
public function testInvalidNetPresentValue() : void
|
||||
{
|
||||
FinanceFormulas::getNetPresentValue([], 0.1);
|
||||
}
|
||||
|
||||
public function testRealRateOfReturn()
|
||||
public function testRealRateOfReturn() : void
|
||||
{
|
||||
$nominal = 0.15;
|
||||
$inflation = 0.05;
|
||||
|
|
@ -397,12 +397,12 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(0.09524, FinanceFormulas::getRealRateOfReturn($nominal, $inflation), '', 0.01);
|
||||
}
|
||||
|
||||
public function testNetWorkingCapital()
|
||||
public function testNetWorkingCapital() : void
|
||||
{
|
||||
self::assertEquals(1000 - 600, FinanceFormulas::getNetWorkingCapital(1000, 600), '', 0.01);
|
||||
}
|
||||
|
||||
public function testNumberOfPeriodsPVFV()
|
||||
public function testNumberOfPeriodsPVFV() : void
|
||||
{
|
||||
$fv = 1200;
|
||||
$pv = 1000;
|
||||
|
|
@ -411,7 +411,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(6.1681, FinanceFormulas::getNumberOfPeriodsPVFV($fv, $pv, $r), '', 0.01);
|
||||
}
|
||||
|
||||
public function testPresentValue()
|
||||
public function testPresentValue() : void
|
||||
{
|
||||
$c = 1000;
|
||||
$r = 0.15;
|
||||
|
|
@ -420,7 +420,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(375.94, FinanceFormulas::getPresentValue($c, $r, $n), '', 0.01);
|
||||
}
|
||||
|
||||
public function testPresentValueContinuousCompounding()
|
||||
public function testPresentValueContinuousCompounding() : void
|
||||
{
|
||||
$c = 1000;
|
||||
$r = 0.15;
|
||||
|
|
|
|||
|
|
@ -17,13 +17,13 @@ use phpOMS\Business\Finance\Loan;
|
|||
|
||||
class LoanTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testRatios()
|
||||
public function testRatios() : void
|
||||
{
|
||||
self::assertEquals(100 / 50, Loan::getLoanToDepositRatio(100, 50));
|
||||
self::assertEquals(100 / 50, Loan::getLoanToValueRatio(100, 50));
|
||||
}
|
||||
|
||||
public function testPaymentsOnBalloonLoan()
|
||||
public function testPaymentsOnBalloonLoan() : void
|
||||
{
|
||||
$pv = 1000;
|
||||
$r = 0.15;
|
||||
|
|
@ -33,7 +33,7 @@ class LoanTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(213.25, Loan::getPaymentsOnBalloonLoan($pv, $r, $n, $balloon), '', 0.01);
|
||||
}
|
||||
|
||||
public function testBalloonBalanceOfLoan()
|
||||
public function testBalloonBalanceOfLoan() : void
|
||||
{
|
||||
$pv = 1000;
|
||||
$p = 300;
|
||||
|
|
@ -43,7 +43,7 @@ class LoanTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(-660.02, Loan::getBalloonBalanceOfLoan($pv, $p, $r, $n), '', 0.01);
|
||||
}
|
||||
|
||||
public function testLoanPayment()
|
||||
public function testLoanPayment() : void
|
||||
{
|
||||
$pv = 1000;
|
||||
$r = 0.15;
|
||||
|
|
@ -52,7 +52,7 @@ class LoanTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(240.36, Loan::getLoanPayment($pv, $r, $n), '', 0.01);
|
||||
}
|
||||
|
||||
public function testRemainingBalanceLoan()
|
||||
public function testRemainingBalanceLoan() : void
|
||||
{
|
||||
$pv = 1000;
|
||||
$p = 200;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use phpOMS\Business\Finance\Lorenzkurve;
|
|||
|
||||
class LorenzkurveTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testLorenz()
|
||||
public function testLorenz() : void
|
||||
{
|
||||
$arr = [1, 1, 1, 1, 1, 1, 1, 10, 33, 50];
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use phpOMS\Business\Finance\StockBonds;
|
|||
|
||||
class StockBondsTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testRatios()
|
||||
public function testRatios() : void
|
||||
{
|
||||
self::assertEquals(100 / 50, StockBonds::getBookValuePerShare(100, 50));
|
||||
self::assertEquals(100 / 50, StockBonds::getCurrentYield(100, 50));
|
||||
|
|
@ -31,34 +31,34 @@ class StockBondsTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(100 / 50, StockBonds::getPriceToSalesRatio(100, 50));
|
||||
}
|
||||
|
||||
public function testBondEquivalentYield()
|
||||
public function testBondEquivalentYield() : void
|
||||
{
|
||||
self::assertEquals(0.40556, StockBonds::getBondEquivalentYield(100, 90, 100), '', 0.01);
|
||||
}
|
||||
|
||||
public function testExpectedReturnCAPM()
|
||||
public function testExpectedReturnCAPM() : void
|
||||
{
|
||||
self::assertEquals(7, StockBonds::getExpectedReturnCAPM(3, 2, 5), '', 0.01);
|
||||
}
|
||||
|
||||
public function testCapitalGainsYield()
|
||||
public function testCapitalGainsYield() : void
|
||||
{
|
||||
self::assertEquals(0.1, StockBonds::getCapitalGainsYield(100, 110), '', 0.01);
|
||||
}
|
||||
|
||||
public function testDilutedEarningsPerShare()
|
||||
public function testDilutedEarningsPerShare() : void
|
||||
{
|
||||
self::assertEquals(9.09, StockBonds::getDilutedEarningsPerShare(1000, 100, 10), '', 0.1);
|
||||
}
|
||||
|
||||
public function testHoldingPeriodReturn()
|
||||
public function testHoldingPeriodReturn() : void
|
||||
{
|
||||
$r = [0.01, 0.02, 0.03, 0.04];
|
||||
|
||||
self::assertEquals(0.10355, StockBonds::getHoldingPeriodReturn($r), '', 0.01);
|
||||
}
|
||||
|
||||
public function testTaxEquivalentYield()
|
||||
public function testTaxEquivalentYield() : void
|
||||
{
|
||||
$free = 0.15;
|
||||
$rate = 0.05;
|
||||
|
|
@ -66,7 +66,7 @@ class StockBondsTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(0.15789, StockBonds::getTaxEquivalentYield($free, $rate), '', 0.01);
|
||||
}
|
||||
|
||||
public function testNetAssetValue()
|
||||
public function testNetAssetValue() : void
|
||||
{
|
||||
$assets = 1000;
|
||||
$liabilities = 300;
|
||||
|
|
@ -75,7 +75,7 @@ class StockBondsTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(1.75, StockBonds::getNetAssetValue($assets, $liabilities, $shares), '', 0.01);
|
||||
}
|
||||
|
||||
public function testPresentValueOfStockConstantGrowth()
|
||||
public function testPresentValueOfStockConstantGrowth() : void
|
||||
{
|
||||
$div = 500;
|
||||
$r = 0.15;
|
||||
|
|
@ -84,7 +84,7 @@ class StockBondsTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(5000, StockBonds::getPresentValueOfStockConstantGrowth($div, $r, $g), '', 0.01);
|
||||
}
|
||||
|
||||
public function testTotalStockReturn()
|
||||
public function testTotalStockReturn() : void
|
||||
{
|
||||
$p0 = 1000;
|
||||
$p1 = 1200;
|
||||
|
|
@ -93,7 +93,7 @@ class StockBondsTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(0.3, StockBonds::getTotalStockReturn($p0, $p1, $d), '', 0.01);
|
||||
}
|
||||
|
||||
public function testYieldToMaturity()
|
||||
public function testYieldToMaturity() : void
|
||||
{
|
||||
$c = 100;
|
||||
$f = 1000;
|
||||
|
|
@ -103,7 +103,7 @@ class StockBondsTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(0.1138, StockBonds::getYieldToMaturity($c, $f, $p, $n), '', 0.01);
|
||||
}
|
||||
|
||||
public function testZeroCouponBondValue()
|
||||
public function testZeroCouponBondValue() : void
|
||||
{
|
||||
$f = 100;
|
||||
$r = 0.06;
|
||||
|
|
@ -112,7 +112,7 @@ class StockBondsTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(74.73, StockBonds::getZeroCouponBondValue($f, $r, $t), '', 0.01);
|
||||
}
|
||||
|
||||
public function testZeroCouponBondEffectiveYield()
|
||||
public function testZeroCouponBondEffectiveYield() : void
|
||||
{
|
||||
$f = 100;
|
||||
$pv = 90;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use phpOMS\Business\Marketing\Metrics;
|
|||
|
||||
class MetricsTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testMetrics()
|
||||
public function testMetrics() : void
|
||||
{
|
||||
self::assertTrue(0.85 - Metrics::getCustomerRetention(105, 20, 100) < 0.01);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,14 +17,14 @@ use phpOMS\Business\Marketing\NetPromoterScore;
|
|||
|
||||
class NetPromoterScoreTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testDefault()
|
||||
public function testDefault() : void
|
||||
{
|
||||
$nps = new NetPromoterScore();
|
||||
|
||||
self::assertEquals(0, $nps->getScore());
|
||||
}
|
||||
|
||||
public function testGetSet()
|
||||
public function testGetSet() : void
|
||||
{
|
||||
$nps = new NetPromoterScore();
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use phpOMS\Business\Programming\Metrics;
|
|||
|
||||
class MetricsTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testMetrics()
|
||||
public function testMetrics() : void
|
||||
{
|
||||
self::assertEquals((int) \sqrt(5 * 5 + 11 * 11 + 9 * 9), Metrics::abcScore(5, 11, 9));
|
||||
|
||||
|
|
|
|||
|
|
@ -16,14 +16,14 @@ use phpOMS\Business\Sales\MarketShareEstimation;
|
|||
|
||||
class MarketShareEstimationTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testZipfRank()
|
||||
public function testZipfRank() : void
|
||||
{
|
||||
self::assertEquals(13, MarketShareEstimation::getRankFromMarketShare(1000, 0.01));
|
||||
self::assertEquals(19, MarketShareEstimation::getRankFromMarketShare(100, 0.01));
|
||||
self::assertEquals(8, MarketShareEstimation::getRankFromMarketShare(100000, 0.01));
|
||||
}
|
||||
|
||||
public function testZipfShare()
|
||||
public function testZipfShare() : void
|
||||
{
|
||||
self::assertTrue(\abs(0.01 - MarketShareEstimation::getMarketShareFromRank(1000, 13)) < 0.01);
|
||||
self::assertTrue(\abs(0.01 - MarketShareEstimation::getMarketShareFromRank(100, 19)) < 0.01);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ require_once __DIR__ . '/../Autoloader.php';
|
|||
class OptionsTraitTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
|
||||
public function testOptionTrait()
|
||||
public function testOptionTrait() : void
|
||||
{
|
||||
$class = new class {
|
||||
use OptionsTrait;
|
||||
|
|
@ -30,7 +30,7 @@ class OptionsTraitTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertObjectHasAttribute('options', $class);
|
||||
}
|
||||
|
||||
public function testDefault()
|
||||
public function testDefault() : void
|
||||
{
|
||||
$class = new class {
|
||||
use OptionsTrait;
|
||||
|
|
@ -40,7 +40,7 @@ class OptionsTraitTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertNull($class->getOption('someKey'));
|
||||
}
|
||||
|
||||
public function testSetGet()
|
||||
public function testSetGet() : void
|
||||
{
|
||||
$class = new class {
|
||||
use OptionsTrait;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use phpOMS\DataStorage\Cache\Connection\FileCache;
|
|||
|
||||
class CachePoolTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testDefault()
|
||||
public function testDefault() : void
|
||||
{
|
||||
$pool = new CachePool();
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ class CachePoolTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertInstanceOf('\phpOMS\DataStorage\Cache\Connection\NullCache', $pool->get());
|
||||
}
|
||||
|
||||
public function testGetSet()
|
||||
public function testGetSet() : void
|
||||
{
|
||||
$pool = new CachePool();
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use phpOMS\DataStorage\Cache\CacheStatus;
|
|||
|
||||
class CacheStatusTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testEnums()
|
||||
public function testEnums() : void
|
||||
{
|
||||
self::assertEquals(4, \count(CacheStatus::getConstants()));
|
||||
self::assertEquals(0, CacheStatus::OK);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use phpOMS\DataStorage\Cache\CacheType;
|
|||
|
||||
class CacheTypeTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testEnums()
|
||||
public function testEnums() : void
|
||||
{
|
||||
self::assertEquals(4, \count(CacheType::getConstants()));
|
||||
self::assertEquals('file', CacheType::FILE);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use phpOMS\DataStorage\Cache\Connection\CacheValueType;
|
|||
|
||||
class CacheValueTypeTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testEnums()
|
||||
public function testEnums() : void
|
||||
{
|
||||
self::assertEquals(8, \count(CacheValueType::getConstants()));
|
||||
self::assertEquals(0, CacheValueType::_INT);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use phpOMS\DataStorage\Cache\Connection\ConnectionFactory;
|
|||
|
||||
class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testCreateFileCache()
|
||||
public function testCreateFileCache() : void
|
||||
{
|
||||
self::assertInstanceOf(
|
||||
\phpOMS\DataStorage\Cache\Connection\FileCache::class,
|
||||
|
|
@ -26,7 +26,7 @@ class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase
|
|||
);
|
||||
}
|
||||
|
||||
public function testCreateMemCached()
|
||||
public function testCreateMemCached() : void
|
||||
{
|
||||
if (!extension_loaded('memcached')) {
|
||||
$this->markTestSkipped(
|
||||
|
|
@ -40,7 +40,7 @@ class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase
|
|||
);
|
||||
}
|
||||
|
||||
public function testCreateRedisCache()
|
||||
public function testCreateRedisCache() : void
|
||||
{
|
||||
if (!extension_loaded('redis')) {
|
||||
$this->markTestSkipped(
|
||||
|
|
@ -57,7 +57,7 @@ class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
*/
|
||||
public function testInvalidCacheType()
|
||||
public function testInvalidCacheType() : void
|
||||
{
|
||||
ConnectionFactory::create(['type' => 'invalid', 'path' => 'Cache']);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class FileCacheJsonSerializable implements \JsonSerializable
|
|||
return 'abc';
|
||||
}
|
||||
|
||||
public function unserialize($val)
|
||||
public function unserialize($val) : void
|
||||
{
|
||||
$this->val = \json_decode($val, true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class FileCacheSerializable implements \Serializable
|
|||
return 'abc';
|
||||
}
|
||||
|
||||
public function unserialize($val)
|
||||
public function unserialize($val) : void
|
||||
{
|
||||
$this->val = $val;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ use phpOMS\Utils\TestUtils;
|
|||
|
||||
class FileCacheTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testDefault()
|
||||
public function testDefault() : void
|
||||
{
|
||||
if (\file_exists(__DIR__ . '/Cache')) {
|
||||
\rmdir(__DIR__ . '/Cache');
|
||||
|
|
@ -40,7 +40,7 @@ class FileCacheTest extends \PHPUnit\Framework\TestCase
|
|||
}
|
||||
}
|
||||
|
||||
public function testConnect()
|
||||
public function testConnect() : void
|
||||
{
|
||||
if (\file_exists(__DIR__ . '/Cache')) {
|
||||
\rmdir(__DIR__ . '/Cache');
|
||||
|
|
@ -55,7 +55,7 @@ class FileCacheTest extends \PHPUnit\Framework\TestCase
|
|||
}
|
||||
}
|
||||
|
||||
public function testGetSet()
|
||||
public function testGetSet() : void
|
||||
{
|
||||
if (\file_exists(__DIR__ . '/Cache')) {
|
||||
\rmdir(__DIR__ . '/Cache');
|
||||
|
|
@ -127,7 +127,7 @@ class FileCacheTest extends \PHPUnit\Framework\TestCase
|
|||
}
|
||||
}
|
||||
|
||||
public function testExpire()
|
||||
public function testExpire() : void
|
||||
{
|
||||
if (\file_exists(__DIR__ . '/Cache')) {
|
||||
\rmdir(__DIR__ . '/Cache');
|
||||
|
|
@ -170,7 +170,7 @@ class FileCacheTest extends \PHPUnit\Framework\TestCase
|
|||
}
|
||||
}
|
||||
|
||||
public function testBadCacheStatus()
|
||||
public function testBadCacheStatus() : void
|
||||
{
|
||||
if (\file_exists(__DIR__ . '/Cache')) {
|
||||
\rmdir(__DIR__ . '/Cache');
|
||||
|
|
@ -198,7 +198,7 @@ class FileCacheTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException
|
||||
*/
|
||||
public function testInvalidCachePath()
|
||||
public function testInvalidCachePath() : void
|
||||
{
|
||||
$cache = new FileCache('/etc/invalidPathOrPermission^$:?><');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ use phpOMS\Utils\TestUtils;
|
|||
|
||||
class MemCachedTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
protected function setUp()
|
||||
protected function setUp() : void
|
||||
{
|
||||
if (!extension_loaded('memcached')) {
|
||||
$this->markTestSkipped(
|
||||
|
|
@ -29,7 +29,7 @@ class MemCachedTest extends \PHPUnit\Framework\TestCase
|
|||
}
|
||||
}
|
||||
|
||||
public function testDefault()
|
||||
public function testDefault() : void
|
||||
{
|
||||
$cache = new MemCached($GLOBALS['CONFIG']['cache']['memcached']);
|
||||
|
||||
|
|
@ -40,7 +40,7 @@ class MemCachedTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(null, $cache->get('test'));
|
||||
}
|
||||
|
||||
public function testConnect()
|
||||
public function testConnect() : void
|
||||
{
|
||||
$cache = new MemCached($GLOBALS['CONFIG']['cache']['memcached']);
|
||||
|
||||
|
|
@ -49,7 +49,7 @@ class MemCachedTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals((int) $GLOBALS['CONFIG']['cache']['memcached']['port'], $cache->getPort());
|
||||
}
|
||||
|
||||
public function testGetSet()
|
||||
public function testGetSet() : void
|
||||
{
|
||||
$cache = new MemCached($GLOBALS['CONFIG']['cache']['memcached']);
|
||||
|
||||
|
|
@ -108,7 +108,7 @@ class MemCachedTest extends \PHPUnit\Framework\TestCase
|
|||
);
|
||||
}
|
||||
|
||||
public function testBadCacheStatus()
|
||||
public function testBadCacheStatus() : void
|
||||
{
|
||||
$cache = new MemCached($GLOBALS['CONFIG']['cache']['memcached']);
|
||||
$cache->flushAll();
|
||||
|
|
@ -128,7 +128,7 @@ class MemCachedTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException
|
||||
*/
|
||||
public function testInvalidCacheHost()
|
||||
public function testInvalidCacheHost() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['cache']['memcached'];
|
||||
unset($db['host']);
|
||||
|
|
@ -139,7 +139,7 @@ class MemCachedTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException
|
||||
*/
|
||||
public function testInvalidCachePort()
|
||||
public function testInvalidCachePort() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['cache']['memcached'];
|
||||
unset($db['port']);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use phpOMS\DataStorage\Cache\Connection\NullCache;
|
|||
|
||||
class NullCacheTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testCache()
|
||||
public function testCache() : void
|
||||
{
|
||||
$cache = new NullCache();
|
||||
$cache->connect([]);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ use phpOMS\Utils\TestUtils;
|
|||
|
||||
class RedisCacheTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
protected function setUp()
|
||||
protected function setUp() : void
|
||||
{
|
||||
if (!extension_loaded('redis')) {
|
||||
$this->markTestSkipped(
|
||||
|
|
@ -29,7 +29,7 @@ class RedisCacheTest extends \PHPUnit\Framework\TestCase
|
|||
}
|
||||
}
|
||||
|
||||
public function testDefault()
|
||||
public function testDefault() : void
|
||||
{
|
||||
$cache = new RedisCache($GLOBALS['CONFIG']['cache']['redis']);
|
||||
|
||||
|
|
@ -41,7 +41,7 @@ class RedisCacheTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(null, $cache->get('test'));
|
||||
}
|
||||
|
||||
public function testConnect()
|
||||
public function testConnect() : void
|
||||
{
|
||||
$cache = new RedisCache($GLOBALS['CONFIG']['cache']['redis']);
|
||||
|
||||
|
|
@ -51,7 +51,7 @@ class RedisCacheTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals((int) $GLOBALS['CONFIG']['cache']['redis']['port'], $cache->getPort());
|
||||
}
|
||||
|
||||
public function testGetSet()
|
||||
public function testGetSet() : void
|
||||
{
|
||||
$cache = new RedisCache($GLOBALS['CONFIG']['cache']['redis']);
|
||||
|
||||
|
|
@ -110,7 +110,7 @@ class RedisCacheTest extends \PHPUnit\Framework\TestCase
|
|||
);
|
||||
}
|
||||
|
||||
public function testBadCacheStatus()
|
||||
public function testBadCacheStatus() : void
|
||||
{
|
||||
$cache = new RedisCache($GLOBALS['CONFIG']['cache']['redis']);
|
||||
$cache->flushAll();
|
||||
|
|
@ -130,7 +130,7 @@ class RedisCacheTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException
|
||||
*/
|
||||
public function testInvalidCacheHost()
|
||||
public function testInvalidCacheHost() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['cache']['redis'];
|
||||
unset($db['host']);
|
||||
|
|
@ -141,7 +141,7 @@ class RedisCacheTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException
|
||||
*/
|
||||
public function testInvalidCachePort()
|
||||
public function testInvalidCachePort() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['cache']['redis'];
|
||||
unset($db['port']);
|
||||
|
|
@ -152,7 +152,7 @@ class RedisCacheTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException
|
||||
*/
|
||||
public function testInvalidCacheDatabase()
|
||||
public function testInvalidCacheDatabase() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['cache']['redis'];
|
||||
unset($db['db']);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException;
|
|||
|
||||
class InvalidConnectionConfigExceptionTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testException()
|
||||
public function testException() : void
|
||||
{
|
||||
self::assertInstanceOf(\InvalidArgumentException::class, new InvalidConnectionConfigException(''));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use phpOMS\DataStorage\Cookie\CookieJar;
|
|||
|
||||
class CookieJarTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testDefault()
|
||||
public function testDefault() : void
|
||||
{
|
||||
$jar = new CookieJar();
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ class CookieJarTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertFalse($jar->delete('asd'));
|
||||
}
|
||||
|
||||
public function testCookie()
|
||||
public function testCookie() : void
|
||||
{
|
||||
$jar = new CookieJar();
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ class CookieJarTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\LockException
|
||||
*/
|
||||
public function testDeleteLocked()
|
||||
public function testDeleteLocked() : void
|
||||
{
|
||||
$jar = new CookieJar();
|
||||
self::assertTrue($jar->set('test', 'value'));
|
||||
|
|
@ -58,7 +58,7 @@ class CookieJarTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\LockException
|
||||
*/
|
||||
public function testSaveLocked()
|
||||
public function testSaveLocked() : void
|
||||
{
|
||||
CookieJar::lock();
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ use phpOMS\DataStorage\Database\Connection\SqlServerConnection;
|
|||
|
||||
class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testCreateMysql()
|
||||
public function testCreateMysql() : void
|
||||
{
|
||||
if (!extension_loaded('pdo_mysql')) {
|
||||
$this->markTestSkipped(
|
||||
|
|
@ -37,7 +37,7 @@ class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase
|
|||
);
|
||||
}
|
||||
|
||||
public function testCreatePostgres()
|
||||
public function testCreatePostgres() : void
|
||||
{
|
||||
if (!extension_loaded('pdo_pgsql')) {
|
||||
$this->markTestSkipped(
|
||||
|
|
@ -53,7 +53,7 @@ class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase
|
|||
);
|
||||
}
|
||||
|
||||
public function testCreateSqlsrv()
|
||||
public function testCreateSqlsrv() : void
|
||||
{
|
||||
if (!extension_loaded('pdo_sqlsrv')) {
|
||||
$this->markTestSkipped(
|
||||
|
|
@ -69,7 +69,7 @@ class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase
|
|||
);
|
||||
}
|
||||
|
||||
public function testCreateSqlite()
|
||||
public function testCreateSqlite() : void
|
||||
{
|
||||
if (!extension_loaded('pdo_sqlite')) {
|
||||
$this->markTestSkipped(
|
||||
|
|
@ -88,7 +88,7 @@ class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
*/
|
||||
public function testInvalidDatabaseType()
|
||||
public function testInvalidDatabaseType() : void
|
||||
{
|
||||
ConnectionFactory::create(['db' => 'invalid']);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use phpOMS\DataStorage\Database\DatabaseStatus;
|
|||
|
||||
class MysqlConnectionTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
protected function setUp()
|
||||
protected function setUp() : void
|
||||
{
|
||||
if (!extension_loaded('pdo_mysql')) {
|
||||
$this->markTestSkipped(
|
||||
|
|
@ -27,7 +27,7 @@ class MysqlConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
}
|
||||
}
|
||||
|
||||
public function testConnect()
|
||||
public function testConnect() : void
|
||||
{
|
||||
$mysql = new MysqlConnection($GLOBALS['CONFIG']['db']['core']['masters']['admin']);
|
||||
|
||||
|
|
@ -41,7 +41,7 @@ class MysqlConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
|
||||
*/
|
||||
public function testInvalidDatabaseType()
|
||||
public function testInvalidDatabaseType() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['db']['core']['masters']['admin'];
|
||||
unset($db['db']);
|
||||
|
|
@ -52,7 +52,7 @@ class MysqlConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
|
||||
*/
|
||||
public function testInvalidHost()
|
||||
public function testInvalidHost() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['db']['core']['masters']['admin'];
|
||||
unset($db['host']);
|
||||
|
|
@ -63,7 +63,7 @@ class MysqlConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
|
||||
*/
|
||||
public function testInvalidPort()
|
||||
public function testInvalidPort() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['db']['core']['masters']['admin'];
|
||||
unset($db['port']);
|
||||
|
|
@ -74,7 +74,7 @@ class MysqlConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
|
||||
*/
|
||||
public function testInvalidDatabase()
|
||||
public function testInvalidDatabase() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['db']['core']['masters']['admin'];
|
||||
unset($db['database']);
|
||||
|
|
@ -85,7 +85,7 @@ class MysqlConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
|
||||
*/
|
||||
public function testInvalidLogin()
|
||||
public function testInvalidLogin() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['db']['core']['masters']['admin'];
|
||||
unset($db['login']);
|
||||
|
|
@ -96,7 +96,7 @@ class MysqlConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
|
||||
*/
|
||||
public function testInvalidPassword()
|
||||
public function testInvalidPassword() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['db']['core']['masters']['admin'];
|
||||
unset($db['password']);
|
||||
|
|
@ -107,7 +107,7 @@ class MysqlConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
|
||||
*/
|
||||
public function testInvalidDatabaseTypeName()
|
||||
public function testInvalidDatabaseTypeName() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['db']['core']['masters']['admin'];
|
||||
$db['db'] = 'invalid';
|
||||
|
|
@ -118,7 +118,7 @@ class MysqlConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
|
||||
*/
|
||||
public function testInvalidDatabaseName()
|
||||
public function testInvalidDatabaseName() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['db']['core']['masters']['admin'];
|
||||
$db['database'] = 'invalid';
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use phpOMS\DataStorage\Database\DatabaseType;
|
|||
|
||||
class NullConnectionTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testConnect()
|
||||
public function testConnect() : void
|
||||
{
|
||||
$null = new NullConnection([]);
|
||||
$null->connect();
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use phpOMS\DataStorage\Database\DatabaseStatus;
|
|||
|
||||
class PostgresConnectionTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
protected function setUp()
|
||||
protected function setUp() : void
|
||||
{
|
||||
if (!extension_loaded('pdo_pgsql')) {
|
||||
$this->markTestSkipped(
|
||||
|
|
@ -26,7 +26,7 @@ class PostgresConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
}
|
||||
}
|
||||
|
||||
public function testConnect()
|
||||
public function testConnect() : void
|
||||
{
|
||||
$psql = new PostgresConnection($GLOBALS['CONFIG']['db']['core']['postgresql']['admin']);
|
||||
self::assertEquals(DatabaseStatus::OK, $psql->getStatus());
|
||||
|
|
@ -39,7 +39,7 @@ class PostgresConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
|
||||
*/
|
||||
public function testInvalidDatabaseType()
|
||||
public function testInvalidDatabaseType() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin'];
|
||||
unset($db['db']);
|
||||
|
|
@ -49,7 +49,7 @@ class PostgresConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
|
||||
*/
|
||||
public function testInvalidHost()
|
||||
public function testInvalidHost() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin'];
|
||||
unset($db['host']);
|
||||
|
|
@ -59,7 +59,7 @@ class PostgresConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
|
||||
*/
|
||||
public function testInvalidPort()
|
||||
public function testInvalidPort() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin'];
|
||||
unset($db['port']);
|
||||
|
|
@ -69,7 +69,7 @@ class PostgresConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
|
||||
*/
|
||||
public function testInvalidDatabase()
|
||||
public function testInvalidDatabase() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin'];
|
||||
unset($db['database']);
|
||||
|
|
@ -79,7 +79,7 @@ class PostgresConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
|
||||
*/
|
||||
public function testInvalidLogin()
|
||||
public function testInvalidLogin() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin'];
|
||||
unset($db['login']);
|
||||
|
|
@ -89,7 +89,7 @@ class PostgresConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
|
||||
*/
|
||||
public function testInvalidPassword()
|
||||
public function testInvalidPassword() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin'];
|
||||
unset($db['password']);
|
||||
|
|
@ -99,7 +99,7 @@ class PostgresConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
|
||||
*/
|
||||
public function testInvalidDatabaseTypeName()
|
||||
public function testInvalidDatabaseTypeName() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin'];
|
||||
$db['db'] = 'invalid';
|
||||
|
|
@ -109,7 +109,7 @@ class PostgresConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* todo: apparently this doesn't throw an exception in postgresql?!
|
||||
*/
|
||||
public function testInvalidDatabaseName()
|
||||
public function testInvalidDatabaseName() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin'];
|
||||
$db['database'] = 'invalid';
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use phpOMS\DataStorage\Database\DatabaseStatus;
|
|||
|
||||
class SQLiteConnectionTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
protected function setUp()
|
||||
protected function setUp() : void
|
||||
{
|
||||
if (!extension_loaded('pdo_sqlite')) {
|
||||
$this->markTestSkipped(
|
||||
|
|
@ -26,7 +26,7 @@ class SQLiteConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
}
|
||||
}
|
||||
|
||||
public function testConnect()
|
||||
public function testConnect() : void
|
||||
{
|
||||
$sqlite = new SQLiteConnection($GLOBALS['CONFIG']['db']['core']['sqlite']['admin']);
|
||||
self::assertEquals(DatabaseStatus::OK, $sqlite->getStatus());
|
||||
|
|
@ -37,7 +37,7 @@ class SQLiteConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
|
||||
*/
|
||||
public function testInvalidDatabaseType()
|
||||
public function testInvalidDatabaseType() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['db']['core']['sqlite']['admin'];
|
||||
unset($db['db']);
|
||||
|
|
@ -47,14 +47,14 @@ class SQLiteConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
|
||||
*/
|
||||
public function testInvalidDatabase()
|
||||
public function testInvalidDatabase() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['db']['core']['sqlite']['admin'];
|
||||
unset($db['database']);
|
||||
$sqlite = new SQLiteConnection($db);
|
||||
}
|
||||
|
||||
static function tearDownAfterClass()
|
||||
public static function tearDownAfterClass() : void
|
||||
{
|
||||
if (\file_exists($GLOBALS['CONFIG']['db']['core']['sqlite']['admin']['database'])) {
|
||||
\unlink($GLOBALS['CONFIG']['db']['core']['sqlite']['admin']['database']);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use phpOMS\DataStorage\Database\Connection\SqlServerConnection;
|
|||
|
||||
class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
protected function setUp()
|
||||
protected function setUp() : void
|
||||
{
|
||||
if (!extension_loaded('pdo_sqlsrv')) {
|
||||
$this->markTestSkipped(
|
||||
|
|
@ -26,7 +26,7 @@ class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
}
|
||||
}
|
||||
|
||||
public function testConnect()
|
||||
public function testConnect() : void
|
||||
{
|
||||
$psql = new SqlServerConnection($GLOBALS['CONFIG']['db']['core']['mssql']['admin']);
|
||||
self::assertEquals(DatabaseStatus::OK, $psql->getStatus());
|
||||
|
|
@ -39,7 +39,7 @@ class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
|
||||
*/
|
||||
public function testInvalidDatabaseType()
|
||||
public function testInvalidDatabaseType() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin'];
|
||||
unset($db['db']);
|
||||
|
|
@ -49,7 +49,7 @@ class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
|
||||
*/
|
||||
public function testInvalidHost()
|
||||
public function testInvalidHost() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin'];
|
||||
unset($db['host']);
|
||||
|
|
@ -59,7 +59,7 @@ class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
|
||||
*/
|
||||
public function testInvalidPort()
|
||||
public function testInvalidPort() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin'];
|
||||
unset($db['port']);
|
||||
|
|
@ -69,7 +69,7 @@ class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
|
||||
*/
|
||||
public function testInvalidDatabase()
|
||||
public function testInvalidDatabase() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin'];
|
||||
unset($db['database']);
|
||||
|
|
@ -79,7 +79,7 @@ class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
|
||||
*/
|
||||
public function testInvalidLogin()
|
||||
public function testInvalidLogin() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin'];
|
||||
unset($db['login']);
|
||||
|
|
@ -89,7 +89,7 @@ class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
|
||||
*/
|
||||
public function testInvalidPassword()
|
||||
public function testInvalidPassword() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin'];
|
||||
unset($db['password']);
|
||||
|
|
@ -99,7 +99,7 @@ class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
|
||||
*/
|
||||
public function testInvalidDatabaseTypeName()
|
||||
public function testInvalidDatabaseTypeName() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin'];
|
||||
$db['db'] = 'invalid';
|
||||
|
|
@ -109,7 +109,7 @@ class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
|
||||
*/
|
||||
public function testInvalidDatabaseName()
|
||||
public function testInvalidDatabaseName() : void
|
||||
{
|
||||
$db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin'];
|
||||
$db['database'] = 'invalid';
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase
|
|||
protected $model = null;
|
||||
protected $modelArray = null;
|
||||
|
||||
protected function setUp()
|
||||
protected function setUp() : void
|
||||
{
|
||||
$this->model = new BaseModel();
|
||||
$this->modelArray = [
|
||||
|
|
@ -133,7 +133,7 @@ class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase
|
|||
)->execute();
|
||||
}
|
||||
|
||||
protected function tearDown()
|
||||
protected function tearDown() : void
|
||||
{
|
||||
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE oms_test_base')->execute();
|
||||
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE oms_test_belongs_to_one')->execute();
|
||||
|
|
@ -143,26 +143,26 @@ class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase
|
|||
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE oms_test_has_many_rel_relations')->execute();
|
||||
}
|
||||
|
||||
public function testDefault()
|
||||
public function testDefault() : void
|
||||
{
|
||||
self::assertEquals('test_base_id', BaseModelMapper::getPrimaryField());
|
||||
self::assertEquals('test_base', BaseModelMapper::getTable());
|
||||
self::assertEquals('test_base_datetime', BaseModelMapper::getCreatedAt());
|
||||
}
|
||||
|
||||
public function testCreate()
|
||||
public function testCreate() : void
|
||||
{
|
||||
self::assertGreaterThan(0, BaseModelMapper::create($this->model));
|
||||
self::assertGreaterThan(0, $this->model->id);
|
||||
}
|
||||
|
||||
public function testCreateArray()
|
||||
public function testCreateArray() : void
|
||||
{
|
||||
self::assertGreaterThan(0, BaseModelMapper::createArray($this->modelArray));
|
||||
self::assertGreaterThan(0, $this->modelArray['id']);
|
||||
}
|
||||
|
||||
public function testRead()
|
||||
public function testRead() : void
|
||||
{
|
||||
$id = BaseModelMapper::create($this->model);
|
||||
$modelR = BaseModelMapper::get($id);
|
||||
|
|
@ -193,7 +193,7 @@ class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(1, count(BaseModelMapper::getAll()));
|
||||
}
|
||||
|
||||
public function testReadArray()
|
||||
public function testReadArray() : void
|
||||
{
|
||||
$id = BaseModelMapper::createArray($this->modelArray);
|
||||
$modelR = BaseModelMapper::getArray($id);
|
||||
|
|
@ -219,7 +219,7 @@ class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(1, count(BaseModelMapper::getAllArray()));
|
||||
}
|
||||
|
||||
public function testUpdate()
|
||||
public function testUpdate() : void
|
||||
{
|
||||
$id = BaseModelMapper::create($this->model);
|
||||
$modelR = BaseModelMapper::get($id);
|
||||
|
|
@ -244,7 +244,7 @@ class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase
|
|||
// todo test update relations
|
||||
}
|
||||
|
||||
public function testUpdateArray()
|
||||
public function testUpdateArray() : void
|
||||
{
|
||||
$id = BaseModelMapper::createArray($this->modelArray);
|
||||
$modelR = BaseModelMapper::getArray($id);
|
||||
|
|
@ -269,7 +269,7 @@ class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase
|
|||
// todo test update relations
|
||||
}
|
||||
|
||||
public function testDelete()
|
||||
public function testDelete() : void
|
||||
{
|
||||
$id = BaseModelMapper::create($this->model);
|
||||
BaseModelMapper::delete($this->model);
|
||||
|
|
|
|||
|
|
@ -17,12 +17,12 @@ use phpOMS\DataStorage\Database\DatabaseExceptionFactory;
|
|||
|
||||
class DatabaseExceptionFactoryTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testException()
|
||||
public function testException() : void
|
||||
{
|
||||
self::assertEquals('\PDOException', DatabaseExceptionFactory::createException(new \PDOException()));
|
||||
}
|
||||
|
||||
public function testExceptionMessage()
|
||||
public function testExceptionMessage() : void
|
||||
{
|
||||
self::assertEquals('', DatabaseExceptionFactory::createExceptionMessage(new \PDOException()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ use phpOMS\DataStorage\Database\DatabaseStatus;
|
|||
|
||||
class DatabasePoolTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testBasicConnection()
|
||||
public function testBasicConnection() : void
|
||||
{
|
||||
$dbPool = new DatabasePool();
|
||||
/** @var array $CONFIG */
|
||||
|
|
@ -28,7 +28,7 @@ class DatabasePoolTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals($dbPool->get()->getStatus(), DatabaseStatus::OK);
|
||||
}
|
||||
|
||||
public function testGetSet()
|
||||
public function testGetSet() : void
|
||||
{
|
||||
$dbPool = new DatabasePool();
|
||||
/** @var array $CONFIG */
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use phpOMS\DataStorage\Database\DatabaseStatus;
|
|||
|
||||
class DatabaseStatusTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testEnums()
|
||||
public function testEnums() : void
|
||||
{
|
||||
self::assertEquals(6, \count(DatabaseStatus::getConstants()));
|
||||
self::assertEquals(0, DatabaseStatus::OK);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use phpOMS\DataStorage\Database\DatabaseType;
|
|||
|
||||
class DatabaseTypeTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testEnums()
|
||||
public function testEnums() : void
|
||||
{
|
||||
self::assertEquals(5, \count(DatabaseType::getConstants()));
|
||||
self::assertEquals('mysql', DatabaseType::MYSQL);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException;
|
|||
|
||||
class InvalidConnectionConfigExceptionTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testException()
|
||||
public function testException() : void
|
||||
{
|
||||
self::assertInstanceOf(\InvalidArgumentException::class, new InvalidConnectionConfigException(''));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use phpOMS\DataStorage\Database\Exception\InvalidDatabaseTypeException;
|
|||
|
||||
class InvalidDatabaseTypeExceptionTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testException()
|
||||
public function testException() : void
|
||||
{
|
||||
self::assertInstanceOf(\InvalidArgumentException::class, new InvalidDatabaseTypeException(''));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use phpOMS\DataStorage\Database\Exception\InvalidMapperException;
|
|||
|
||||
class InvalidMapperExceptionTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testException()
|
||||
public function testException() : void
|
||||
{
|
||||
self::assertInstanceOf(\RuntimeException::class, new InvalidMapperException(''));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,12 +20,12 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
|
|||
{
|
||||
protected $con = null;
|
||||
|
||||
protected function setUp()
|
||||
protected function setUp() : void
|
||||
{
|
||||
$this->con = new MysqlConnection($GLOBALS['CONFIG']['db']['core']['masters']['admin']);
|
||||
}
|
||||
|
||||
public function testMysqlSelect()
|
||||
public function testMysqlSelect() : void
|
||||
{
|
||||
$query = new Builder($this->con);
|
||||
$sql = 'SELECT `a`.`test` FROM `a` WHERE `a`.`test` = 1;';
|
||||
|
|
@ -74,7 +74,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
|
|||
);
|
||||
}
|
||||
|
||||
public function testMysqlOrder()
|
||||
public function testMysqlOrder() : void
|
||||
{
|
||||
$query = new Builder($this->con);
|
||||
$sql = 'SELECT `a`.`test` FROM `a` WHERE `a`.`test` = 1 ORDER BY `a`.`test` DESC;';
|
||||
|
|
@ -101,7 +101,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals($sql, $query->select('a.test')->from('a')->where('a.test', '=', 1)->orderBy(['a.test', 'a.test2'], 'ASC')->toSql());
|
||||
}
|
||||
|
||||
public function testMysqlOffsetLimit()
|
||||
public function testMysqlOffsetLimit() : void
|
||||
{
|
||||
$query = new Builder($this->con);
|
||||
$sql = 'SELECT `a`.`test` FROM `a` WHERE `a`.`test` = 1 LIMIT 3;';
|
||||
|
|
@ -112,7 +112,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals($sql, $query->select('a.test')->from('a')->where('a.test', '=', 1)->offset(3)->toSql());
|
||||
}
|
||||
|
||||
public function testMysqlGroup()
|
||||
public function testMysqlGroup() : void
|
||||
{
|
||||
$query = new Builder($this->con);
|
||||
$sql = 'SELECT `a`.`test` FROM `a` WHERE `a`.`test` = 1 GROUP BY `a`;';
|
||||
|
|
@ -130,7 +130,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals($sql, $query->select('a.test')->from('a')->where('a.test', '=', ':test')->groupBy('a', 'b')->toSql());
|
||||
}
|
||||
|
||||
public function testMysqlWheres()
|
||||
public function testMysqlWheres() : void
|
||||
{
|
||||
$query = new Builder($this->con);
|
||||
$sql = 'SELECT `a`.`test` FROM `a` WHERE `a`.`test` = 1;';
|
||||
|
|
@ -189,7 +189,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals($sql, $query->select('a.test')->from('a')->where('a.test', '=', ':testWhere')->whereIn('a.test2', ['a', ':bValue', 'c'], 'or')->toSql());
|
||||
}
|
||||
|
||||
public function testMysqlJoins()
|
||||
public function testMysqlJoins() : void
|
||||
{
|
||||
$query = new Builder($this->con);
|
||||
$sql = 'SELECT `a`.`test` FROM `a` JOIN `b` ON `a`.`id` = `b`.`id` WHERE `a`.`test` = 1;';
|
||||
|
|
@ -248,7 +248,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals($sql, $query->select('a.test')->from('a')->fullOuterJoin('b')->on('a.id', '=', 'b.id')->where('a.test', '=', 1)->toSql());
|
||||
}
|
||||
|
||||
public function testMysqlInsert()
|
||||
public function testMysqlInsert() : void
|
||||
{
|
||||
$query = new Builder($this->con);
|
||||
$sql = 'INSERT INTO `a` VALUES (1, \'test\');';
|
||||
|
|
@ -272,7 +272,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals($sql, $query->insert('test', 'test2')->into('a')->values(':test', ':test2')->toSql());
|
||||
}
|
||||
|
||||
public function testMysqlDelete()
|
||||
public function testMysqlDelete() : void
|
||||
{
|
||||
$query = new Builder($this->con);
|
||||
$sql = 'DELETE FROM `a` WHERE `a`.`test` = 1;';
|
||||
|
|
@ -283,7 +283,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals($sql, $query->delete()->from('a')->where('a.test', '=', ':testVal')->toSql());
|
||||
}
|
||||
|
||||
public function testMysqlUpdate()
|
||||
public function testMysqlUpdate() : void
|
||||
{
|
||||
$query = new Builder($this->con);
|
||||
$sql = 'UPDATE `a` SET `a`.`test` = 1, `a`.`test2` = 2 WHERE `a`.`test` = 1;';
|
||||
|
|
@ -298,7 +298,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals($sql, $query->update('a')->set(['a.test' => 1])->set(['a.test2' => ':test2'])->where('a.test', '=', ':test3')->toSql());
|
||||
}
|
||||
|
||||
public function testRaw()
|
||||
public function testRaw() : void
|
||||
{
|
||||
$query = new Builder($this->con);
|
||||
self::assertEquals('SELECT test.val FROM test;', $query->raw('SELECT test.val FROM test;')->toSql());
|
||||
|
|
@ -307,7 +307,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \Exception
|
||||
*/
|
||||
public function testReadOnlyRaw()
|
||||
public function testReadOnlyRaw() : void
|
||||
{
|
||||
$query = new Builder($this->con, true);
|
||||
$query->raw('DROP DATABASE oms;');
|
||||
|
|
@ -316,7 +316,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \Exception
|
||||
*/
|
||||
public function testReadOnlyInsert()
|
||||
public function testReadOnlyInsert() : void
|
||||
{
|
||||
$query = new Builder($this->con, true);
|
||||
$query->insert('test');
|
||||
|
|
@ -325,7 +325,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \Exception
|
||||
*/
|
||||
public function testReadOnlyUpdate()
|
||||
public function testReadOnlyUpdate() : void
|
||||
{
|
||||
$query = new Builder($this->con, true);
|
||||
$query->update();
|
||||
|
|
@ -334,7 +334,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \Exception
|
||||
*/
|
||||
public function testReadOnlyDelete()
|
||||
public function testReadOnlyDelete() : void
|
||||
{
|
||||
$query = new Builder($this->con, true);
|
||||
$query->delete();
|
||||
|
|
@ -343,7 +343,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
*/
|
||||
public function testInvalidWhereOperator()
|
||||
public function testInvalidWhereOperator() : void
|
||||
{
|
||||
$query = new Builder($this->con, true);
|
||||
$query->where('a', 'invalid', 'b');
|
||||
|
|
@ -352,7 +352,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
*/
|
||||
public function testInvalidJoinTable()
|
||||
public function testInvalidJoinTable() : void
|
||||
{
|
||||
$query = new Builder($this->con, true);
|
||||
$query->join(null);
|
||||
|
|
@ -361,7 +361,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
*/
|
||||
public function testInvalidJoinOperator()
|
||||
public function testInvalidJoinOperator() : void
|
||||
{
|
||||
$query = new Builder($this->con, true);
|
||||
$query->join('b')->on('a', 'invalid', 'b');
|
||||
|
|
@ -370,7 +370,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
*/
|
||||
public function testInvalidOrOrderType()
|
||||
public function testInvalidOrOrderType() : void
|
||||
{
|
||||
$query = new Builder($this->con, true);
|
||||
$query->orderBy('a', 1);
|
||||
|
|
@ -379,7 +379,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
|
|||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
*/
|
||||
public function testInvalidOrColumnType()
|
||||
public function testInvalidOrColumnType() : void
|
||||
{
|
||||
$query = new Builder($this->con, true);
|
||||
$query->orderBy(null, 'DESC');
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace phpOMS\tests\DataStorage\Database\Query;
|
|||
|
||||
class ColumnTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testPlaceholder()
|
||||
public function testPlaceholder() : void
|
||||
{
|
||||
self::markTestIncomplete();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace phpOMS\tests\DataStorage\Database\Query;
|
|||
|
||||
class CountTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testPlaceholder()
|
||||
public function testPlaceholder() : void
|
||||
{
|
||||
self::markTestIncomplete();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace phpOMS\tests\DataStorage\Database\Query;
|
|||
|
||||
class ExpressionTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testPlaceholder()
|
||||
public function testPlaceholder() : void
|
||||
{
|
||||
self::markTestIncomplete();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace phpOMS\tests\DataStorage\Database\Query;
|
|||
|
||||
class FromTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testPlaceholder()
|
||||
public function testPlaceholder() : void
|
||||
{
|
||||
self::markTestIncomplete();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use phpOMS\DataStorage\Database\Query\Grammar\Grammar;
|
|||
|
||||
class GrammarTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testDefault()
|
||||
public function testDefault() : void
|
||||
{
|
||||
$grammar = new Grammar();
|
||||
self::assertEquals('Y-m-d H:i:s', $grammar->getDateFormat());
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use phpOMS\DataStorage\Database\Query\Grammar\MicrosoftGrammar;
|
|||
|
||||
class MicrosoftGrammarTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testDefault()
|
||||
public function testDefault() : void
|
||||
{
|
||||
self::assertInstanceOf('\phpOMS\DataStorage\Database\Query\Grammar\Grammar', new MicrosoftGrammar());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use phpOMS\Utils\TestUtils;
|
|||
|
||||
class MysqlGrammarTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testDefault()
|
||||
public function testDefault() : void
|
||||
{
|
||||
self::assertInstanceOf('\phpOMS\DataStorage\Database\Query\Grammar\Grammar', new MysqlGrammar());
|
||||
self::assertEquals('`', TestUtils::getMember(new MysqlGrammar(), 'systemIdentifier'));
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use phpOMS\DataStorage\Database\Query\Grammar\OracleGrammar;
|
|||
|
||||
class OracleGrammarTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testDefault()
|
||||
public function testDefault() : void
|
||||
{
|
||||
self::assertInstanceOf('\phpOMS\DataStorage\Database\Query\Grammar\Grammar', new OracleGrammar());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use phpOMS\DataStorage\Database\Query\Grammar\PostgresGrammar;
|
|||
|
||||
class PostgresGrammarTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testDefault()
|
||||
public function testDefault() : void
|
||||
{
|
||||
self::assertInstanceOf('\phpOMS\DataStorage\Database\Query\Grammar\Grammar', new PostgresGrammar());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use phpOMS\Utils\TestUtils;
|
|||
|
||||
class SQLiteGrammarTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testDefault()
|
||||
public function testDefault() : void
|
||||
{
|
||||
self::assertInstanceOf('\phpOMS\DataStorage\Database\Query\Grammar\Grammar', new SqliteGrammar());
|
||||
self::assertEquals('`', TestUtils::getMember(new SqliteGrammar(), 'systemIdentifier'));
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace phpOMS\tests\DataStorage\Database\Query;
|
|||
|
||||
class IntoTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testPlaceholder()
|
||||
public function testPlaceholder() : void
|
||||
{
|
||||
self::markTestIncomplete();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use phpOMS\DataStorage\Database\Query\JoinType;
|
|||
|
||||
class JoinTypeTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testEnums()
|
||||
public function testEnums() : void
|
||||
{
|
||||
self::assertEquals(12, \count(JoinType::getConstants()));
|
||||
self::assertEquals(JoinType::getConstants(), array_unique(JoinType::getConstants()));
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use phpOMS\DataStorage\Database\Query\QueryType;
|
|||
|
||||
class QueryTypeTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testEnums()
|
||||
public function testEnums() : void
|
||||
{
|
||||
self::assertEquals(7, \count(QueryType::getConstants()));
|
||||
self::assertEquals(QueryType::getConstants(), array_unique(QueryType::getConstants()));
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user