php cs fixer

This commit is contained in:
Dennis Eichhorn 2018-12-28 19:13:07 +01:00
parent 9a09993336
commit a80224b07d
415 changed files with 1155 additions and 1155 deletions

View File

@ -753,7 +753,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function lock() public function lock() : void
{ {
} }
@ -764,7 +764,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function lockUpdate() public function lockUpdate() : void
{ {
} }
@ -787,7 +787,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function find() public function find() : void
{ {
} }
@ -813,7 +813,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function min() public function min() : void
{ {
} }
@ -824,7 +824,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function max() public function max() : void
{ {
} }
@ -835,7 +835,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function sum() public function sum() : void
{ {
} }
@ -846,7 +846,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function avg() public function avg() : void
{ {
} }
@ -1032,7 +1032,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function increment() public function increment() : void
{ {
} }
@ -1043,7 +1043,7 @@ class Builder extends BuilderAbstract
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function decrement() public function decrement() : void
{ {
} }

View File

@ -104,7 +104,7 @@ class Builder extends QueryBuilder
return $this; return $this;
} }
public function alter(array $column) public function alter(array $column) : void
{ {
} }

View File

@ -66,7 +66,7 @@ final class EventManager implements \Countable
public function __construct(Dispatcher $dispatcher = null) public function __construct(Dispatcher $dispatcher = null)
{ {
$this->dispatcher = $dispatcher ?? new class { $this->dispatcher = $dispatcher ?? new class {
public function dispatch($func, ...$data) public function dispatch($func, ...$data) : void
{ {
$func(...$data); $func(...$data);
} }

View File

@ -732,7 +732,7 @@ class Matrix implements \ArrayAccess, \Iterator
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function next() public function next() : void
{ {
++$this->position; ++$this->position;
} }
@ -766,7 +766,7 @@ class Matrix implements \ArrayAccess, \Iterator
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function rewind() public function rewind() : void
{ {
$this->position = 0; $this->position = 0;
} }
@ -774,7 +774,7 @@ class Matrix implements \ArrayAccess, \Iterator
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function offsetSet($offset, $value) public function offsetSet($offset, $value) : void
{ {
$row = (int) ($offset / $this->m); $row = (int) ($offset / $this->m);
$this->matrix[$row][$offset - $row * $this->n] = $value; $this->matrix[$row][$offset - $row * $this->n] = $value;
@ -783,7 +783,7 @@ class Matrix implements \ArrayAccess, \Iterator
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function offsetUnset($offset) public function offsetUnset($offset) : void
{ {
$row = (int) ($offset / $this->m); $row = (int) ($offset / $this->m);
unset($this->matrix[$row][$offset - $row * $this->n]); unset($this->matrix[$row][$offset - $row * $this->n]);

View File

@ -18,7 +18,7 @@ use phpOMS\Math\Matrix\Matrix;
class MultipleLinearRegression class MultipleLinearRegression
{ {
/** /**
* {@inheritdoc} *
*/ */
public static function getRegression(array $x, array $y) : array public static function getRegression(array $x, array $y) : array
{ {
@ -33,21 +33,21 @@ class MultipleLinearRegression
} }
/** /**
* {@inheritdoc} *
*/ */
public static function getVariance() : float public static function getVariance() : float
{ {
} }
/** /**
* {@inheritdoc} *
*/ */
public static function getPredictionInterval() : array public static function getPredictionInterval() : array
{ {
} }
/** /**
* {@inheritdoc} *
*/ */
public static function getSlope(float $b1, float $y, float $x) : float 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 public static function getElasticity(float $b1, float $y, float $x): float
{ {

View File

@ -190,7 +190,7 @@ final class MeasureOfDispersion
* *
* @return float * @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 * @throws InvalidDimensionException This exception is thrown if x and y have different dimensions
* *
* @since 1.0.0 * @since 1.0.0

View File

@ -41,7 +41,7 @@ interface UploadedFileInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function moveTo(string $targetPath); public function moveTo(string $targetPath) : void;
/** /**
* Retrieve the file size. * Retrieve the file size.

View File

@ -146,7 +146,7 @@ class Dom implements \Serializable, ArrayableInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function unserialize($raw) public function unserialize($raw) : void
{ {
$unserialized = \json_decode($raw, true); $unserialized = \json_decode($raw, true);

View File

@ -82,7 +82,7 @@ class FormValidation implements \Serializable, ArrayableInterface, \JsonSerializ
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function unserialize($raw) public function unserialize($raw) : void
{ {
$unserialized = \json_decode($raw, true); $unserialized = \json_decode($raw, true);

View File

@ -186,7 +186,7 @@ class Notify implements \Serializable, ArrayableInterface, \JsonSerializable
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function unserialize($raw) public function unserialize($raw) : void
{ {
$unserialized = \json_decode($raw, true); $unserialized = \json_decode($raw, true);

View File

@ -128,7 +128,7 @@ class Redirect implements \Serializable, ArrayableInterface, \JsonSerializable
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function unserialize($raw) public function unserialize($raw) : void
{ {
$unserialized = \json_decode($raw, true); $unserialized = \json_decode($raw, true);

View File

@ -84,7 +84,7 @@ class Reload implements \Serializable, ArrayableInterface, \JsonSerializable
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function unserialize($raw) public function unserialize($raw) : void
{ {
$unserialized = \json_decode($raw, true); $unserialized = \json_decode($raw, true);

View File

@ -32,5 +32,5 @@ interface ConsoleInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function callConsole(); public function callConsole() : void;
} }

View File

@ -32,5 +32,5 @@ interface SocketInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function callSock(); public function callSock() : void;
} }

View File

@ -39,7 +39,7 @@ class Client extends SocketAbstract
$this->commands = new CommandManager(); $this->commands = new CommandManager();
/** @noinspection PhpUnusedParameterInspection */ /** @noinspection PhpUnusedParameterInspection */
$this->commands->attach('disconnect', function ($conn, $para) { $this->commands->attach('disconnect', function ($conn, $para) : void {
$this->disconnect(); $this->disconnect();
}, $this); }, $this);
} }

View File

@ -173,7 +173,7 @@ class Header implements \Serializable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function unserialize($string) public function unserialize($string) : void
{ {
} }
} }

View File

@ -68,7 +68,7 @@ abstract class PacketAbstract implements \Serializable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
abstract public function unserialize($string); abstract public function unserialize($string) : void;
/** /**
* Get packet header. * Get packet header.

View File

@ -21,7 +21,7 @@ class ClientManager
{ {
private $clients = []; private $clients = [];
public function add(ClientConnection $client) public function add(ClientConnection $client) : void
{ {
$this->clients[$client->getId()] = $client; $this->clients[$client->getId()] = $client;
} }

View File

@ -280,7 +280,7 @@ class Iban implements \Serializable
* @return void * @return void
* @since 5.1.0 * @since 5.1.0
*/ */
public function unserialize($serialized) public function unserialize($serialized) : void
{ {
$this->parse($serialized); $this->parse($serialized);
} }

View File

@ -332,7 +332,7 @@ class Location implements \JsonSerializable, \Serializable
* @return void * @return void
* @since 5.1.0 * @since 5.1.0
*/ */
public function unserialize($serialized) public function unserialize($serialized) : void
{ {
} }
} }

View File

@ -127,7 +127,7 @@ class Tree extends Graph
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function levelOrder(Node $node, \Closure $callback) public function levelOrder(Node $node, \Closure $callback) : void
{ {
$depth = $this->getMaxDepth(); $depth = $this->getMaxDepth();

View File

@ -323,7 +323,7 @@ class PriorityQueue implements \Countable, \Serializable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function unserialize($data) public function unserialize($data) : void
{ {
$this->queue = \json_decode($data); $this->queue = \json_decode($data);
} }

View File

@ -51,7 +51,7 @@ class Directory extends FileAbstract implements DirectoryInterface
return \in_array(LocalFile::name($path), $list); 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); $parts = \explode('/', $path);
\ftp_chdir($con, '/' . $parts[0]); \ftp_chdir($con, '/' . $parts[0]);
@ -272,7 +272,7 @@ class Directory extends FileAbstract implements DirectoryInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function rewind() public function rewind() : void
{ {
\reset($this->nodes); \reset($this->nodes);
} }
@ -314,7 +314,7 @@ class Directory extends FileAbstract implements DirectoryInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function offsetSet($offset, $value) public function offsetSet($offset, $value) : void
{ {
if ($offset === null) { if ($offset === null) {
$this->addNode($value); $this->addNode($value);
@ -334,7 +334,7 @@ class Directory extends FileAbstract implements DirectoryInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function offsetUnset($offset) public function offsetUnset($offset) : void
{ {
if (isset($this->nodes[$offset])) { if (isset($this->nodes[$offset])) {
unset($this->nodes[$offset]); unset($this->nodes[$offset]);

View File

@ -457,7 +457,7 @@ final class Directory extends FileAbstract implements DirectoryInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function rewind() public function rewind() : void
{ {
\reset($this->nodes); \reset($this->nodes);
} }
@ -499,7 +499,7 @@ final class Directory extends FileAbstract implements DirectoryInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function offsetSet($offset, $value) public function offsetSet($offset, $value) : void
{ {
if ($offset === null) { if ($offset === null) {
$this->addNode($value); $this->addNode($value);
@ -519,7 +519,7 @@ final class Directory extends FileAbstract implements DirectoryInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function offsetUnset($offset) public function offsetUnset($offset) : void
{ {
if (isset($this->nodes[$offset])) { if (isset($this->nodes[$offset])) {
unset($this->nodes[$offset]); unset($this->nodes[$offset]);
@ -595,7 +595,7 @@ final class Directory extends FileAbstract implements DirectoryInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function offsetGet($offset) public function offsetGet($offset) : void
{ {
// TODO: Implement offsetGet() method. // TODO: Implement offsetGet() method.
} }

View File

@ -22,7 +22,7 @@ class ExcelDatabaseMapper implements IODatabaseMapper
private $lineBuffer = 500; private $lineBuffer = 500;
public function addSource(string $source) public function addSource(string $source) : void
{ {
$this->sources[] = $source; $this->sources[] = $source;
} }
@ -37,7 +37,7 @@ class ExcelDatabaseMapper implements IODatabaseMapper
$this->sources = $sources; $this->sources = $sources;
} }
public function insert() public function insert() : void
{ {
} }
} }

View File

@ -34,7 +34,7 @@ interface ExcelInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function exportExcel($path); public function exportExcel($path) : void;
/** /**
* Import Excel. * Import Excel.
@ -45,5 +45,5 @@ interface ExcelInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function importExcel($path); public function importExcel($path) : void;
} }

View File

@ -34,7 +34,7 @@ interface JsonInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function exportJson($path); public function exportJson($path) : void;
/** /**
* Import Json. * Import Json.
@ -45,5 +45,5 @@ interface JsonInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function importJson($path); public function importJson($path) : void;
} }

View File

@ -34,5 +34,5 @@ interface PdfInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function exportPdf($path); public function exportPdf($path) : void;
} }

View File

@ -86,7 +86,7 @@ final class JsonBuilder implements \Serializable, \JsonSerializable
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function unserialize($serialized) public function unserialize($serialized) : void
{ {
$this->json = \json_decode($serialized, true); $this->json = \json_decode($serialized, true);
} }

View File

@ -107,7 +107,7 @@ final class Permutation
* @return mixed * @return mixed
* *
* @throws \InvalidArgumentException This exception is thrown if the $toPermute argument is neither array or string * @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 * @since 1.0.0
*/ */

View File

@ -114,7 +114,7 @@ class Interval implements \Serializable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function unserialize($serialized) public function unserialize($serialized) : void
{ {
$elements = \explode(' ', \trim($serialized)); $elements = \explode(' ', \trim($serialized));

View File

@ -72,7 +72,7 @@ class PaginationView extends View
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function setMaxPages(int $maxPages) public function setMaxPages(int $maxPages) : void
{ {
$this->maxPages = $maxPages; $this->maxPages = $maxPages;
} }
@ -94,7 +94,7 @@ class PaginationView extends View
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function setPages(int $pages) public function setPages(int $pages) : void
{ {
$this->pages = $pages; $this->pages = $pages;
} }
@ -116,7 +116,7 @@ class PaginationView extends View
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function setPage(int $page = 1) public function setPage(int $page = 1) : void
{ {
$this->page = $page; $this->page = $page;
} }
@ -138,7 +138,7 @@ class PaginationView extends View
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function setResults(int $results = 0) public function setResults(int $results = 0) : void
{ {
$this->results = $results; $this->results = $results;
} }

View File

@ -275,7 +275,7 @@ abstract class ViewAbstract implements \Serializable
* @since 1.0.0 * @since 1.0.0
* @codeCoverageIgnore * @codeCoverageIgnore
*/ */
public function unserialize($raw) public function unserialize($raw) : void
{ {
} }
} }

View File

@ -21,7 +21,7 @@ require_once __DIR__ . '/../Autoloader.php';
class AccountManagerTest extends \PHPUnit\Framework\TestCase class AccountManagerTest extends \PHPUnit\Framework\TestCase
{ {
public function testAttributes() public function testAttributes() : void
{ {
$manager = new AccountManager($GLOBALS['httpSession']); $manager = new AccountManager($GLOBALS['httpSession']);
self::assertInstanceOf('\phpOMS\Account\AccountManager', $manager); self::assertInstanceOf('\phpOMS\Account\AccountManager', $manager);
@ -30,7 +30,7 @@ class AccountManagerTest extends \PHPUnit\Framework\TestCase
self::assertObjectHasAttribute('accounts', $manager); self::assertObjectHasAttribute('accounts', $manager);
} }
public function testDefault() public function testDefault() : void
{ {
$manager = new AccountManager($GLOBALS['httpSession']); $manager = new AccountManager($GLOBALS['httpSession']);
@ -39,7 +39,7 @@ class AccountManagerTest extends \PHPUnit\Framework\TestCase
self::assertInstanceOf('\phpOMS\Account\NullAccount', $manager->get(-1)); self::assertInstanceOf('\phpOMS\Account\NullAccount', $manager->get(-1));
} }
public function testSetGet() public function testSetGet() : void
{ {
$manager = new AccountManager($GLOBALS['httpSession']); $manager = new AccountManager($GLOBALS['httpSession']);
$account = new Account(3); $account = new Account(3);

View File

@ -19,7 +19,7 @@ use phpOMS\Account\AccountStatus;
class AccountStatusTest extends \PHPUnit\Framework\TestCase class AccountStatusTest extends \PHPUnit\Framework\TestCase
{ {
public function testEnums() public function testEnums() : void
{ {
self::assertEquals(4, \count(AccountStatus::getConstants())); self::assertEquals(4, \count(AccountStatus::getConstants()));
self::assertEquals(1, AccountStatus::ACTIVE); self::assertEquals(1, AccountStatus::ACTIVE);

View File

@ -28,12 +28,12 @@ class AccountTest extends \PHPUnit\Framework\TestCase
{ {
protected $l11nManager = null; protected $l11nManager = null;
protected function setUp() protected function setUp() : void
{ {
$this->l11nManager = new L11nManager('Api'); $this->l11nManager = new L11nManager('Api');
} }
public function testAttributes() public function testAttributes() : void
{ {
$account = new Account(); $account = new Account();
self::assertInstanceOf('\phpOMS\Account\Account', $account); self::assertInstanceOf('\phpOMS\Account\Account', $account);
@ -55,7 +55,7 @@ class AccountTest extends \PHPUnit\Framework\TestCase
self::assertObjectHasAttribute('l11n', $account); self::assertObjectHasAttribute('l11n', $account);
} }
public function testDefault() public function testDefault() : void
{ {
$account = new Account(); $account = new Account();
@ -99,7 +99,7 @@ class AccountTest extends \PHPUnit\Framework\TestCase
self::assertEquals($array, $account->jsonSerialize()); self::assertEquals($array, $account->jsonSerialize());
} }
public function testSetGet() public function testSetGet() : void
{ {
$account = new Account(); $account = new Account();
@ -168,7 +168,7 @@ class AccountTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testEmailException() public function testEmailException() : void
{ {
$account = new Account(); $account = new Account();
$account->setEmail('d.duck!@#%@duckburg'); $account->setEmail('d.duck!@#%@duckburg');
@ -177,7 +177,7 @@ class AccountTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\Stdlib\Base\Exception\InvalidEnumValue * @expectedException \phpOMS\Stdlib\Base\Exception\InvalidEnumValue
*/ */
public function testStatusException() public function testStatusException() : void
{ {
$account = new Account(); $account = new Account();
$account->setStatus(99); $account->setStatus(99);
@ -186,7 +186,7 @@ class AccountTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\Stdlib\Base\Exception\InvalidEnumValue * @expectedException \phpOMS\Stdlib\Base\Exception\InvalidEnumValue
*/ */
public function testTypeException() public function testTypeException() : void
{ {
$account = new Account(); $account = new Account();
$account->setType(99); $account->setType(99);

View File

@ -19,7 +19,7 @@ use phpOMS\Account\AccountType;
class AccountTypeTest extends \PHPUnit\Framework\TestCase class AccountTypeTest extends \PHPUnit\Framework\TestCase
{ {
public function testEnums() public function testEnums() : void
{ {
self::assertEquals(2, \count(AccountType::getConstants())); self::assertEquals(2, \count(AccountType::getConstants()));
self::assertEquals(0, AccountType::USER); self::assertEquals(0, AccountType::USER);

View File

@ -19,7 +19,7 @@ use phpOMS\Account\GroupStatus;
class GroupStatusTest extends \PHPUnit\Framework\TestCase class GroupStatusTest extends \PHPUnit\Framework\TestCase
{ {
public function testEnums() public function testEnums() : void
{ {
self::assertEquals(3, \count(GroupStatus::getConstants())); self::assertEquals(3, \count(GroupStatus::getConstants()));
self::assertEquals(1, GroupStatus::ACTIVE); self::assertEquals(1, GroupStatus::ACTIVE);

View File

@ -20,7 +20,7 @@ require_once __DIR__ . '/../Autoloader.php';
class GroupTest extends \PHPUnit\Framework\TestCase class GroupTest extends \PHPUnit\Framework\TestCase
{ {
public function testAttributes() public function testAttributes() : void
{ {
$group = new Group(); $group = new Group();
self::assertInstanceOf('\phpOMS\Account\Group', $group); self::assertInstanceOf('\phpOMS\Account\Group', $group);
@ -35,7 +35,7 @@ class GroupTest extends \PHPUnit\Framework\TestCase
self::assertObjectHasAttribute('status', $group); self::assertObjectHasAttribute('status', $group);
} }
public function testDefault() public function testDefault() : void
{ {
$group = new Group(); $group = new Group();
@ -59,7 +59,7 @@ class GroupTest extends \PHPUnit\Framework\TestCase
self::assertEquals($array, $group->jsonSerialize()); self::assertEquals($array, $group->jsonSerialize());
} }
public function testSetGet() public function testSetGet() : void
{ {
$group = new Group(); $group = new Group();
@ -76,7 +76,7 @@ class GroupTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\Stdlib\Base\Exception\InvalidEnumValue * @expectedException \phpOMS\Stdlib\Base\Exception\InvalidEnumValue
*/ */
public function testStatusException() public function testStatusException() : void
{ {
$account = new Group(); $account = new Group();
$account->setStatus(99); $account->setStatus(99);

View File

@ -19,7 +19,7 @@ use phpOMS\Account\NullAccount;
class NullAccountTest extends \PHPUnit\Framework\TestCase class NullAccountTest extends \PHPUnit\Framework\TestCase
{ {
public function testNull() public function testNull() : void
{ {
self::assertInstanceOf('\phpOMS\Account\Account', new NullAccount()); self::assertInstanceOf('\phpOMS\Account\Account', new NullAccount());
} }

View File

@ -20,7 +20,7 @@ use phpOMS\Account\PermissionType;
class PermissionAbstractTest extends \PHPUnit\Framework\TestCase class PermissionAbstractTest extends \PHPUnit\Framework\TestCase
{ {
public function testAbstractDefault() public function testAbstractDefault() : void
{ {
$perm = new class extends PermissionAbstract {}; $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 {}; $perm = new class extends PermissionAbstract {};

View File

@ -19,7 +19,7 @@ use phpOMS\Account\PermissionType;
class PermissionTypeTest extends \PHPUnit\Framework\TestCase class PermissionTypeTest extends \PHPUnit\Framework\TestCase
{ {
public function testEnums() public function testEnums() : void
{ {
self::assertEquals(6, \count(PermissionType::getConstants())); self::assertEquals(6, \count(PermissionType::getConstants()));
self::assertEquals(PermissionType::getConstants(), array_unique(PermissionType::getConstants())); self::assertEquals(PermissionType::getConstants(), array_unique(PermissionType::getConstants()));

View File

@ -17,7 +17,7 @@ use phpOMS\ApplicationAbstract;
class ApplicationAbstractTest extends \PHPUnit\Framework\TestCase class ApplicationAbstractTest extends \PHPUnit\Framework\TestCase
{ {
public function testGetSet() public function testGetSet() : void
{ {
$obj = new class extends ApplicationAbstract {}; $obj = new class extends ApplicationAbstract {};

View File

@ -19,7 +19,7 @@ require_once __DIR__ . '/../Autoloader.php';
class AssetManagerTest extends \PHPUnit\Framework\TestCase class AssetManagerTest extends \PHPUnit\Framework\TestCase
{ {
public function testAttributes() public function testAttributes() : void
{ {
$manager = new AssetManager(); $manager = new AssetManager();
self::assertInstanceOf('\phpOMS\Asset\AssetManager', $manager); self::assertInstanceOf('\phpOMS\Asset\AssetManager', $manager);
@ -28,7 +28,7 @@ class AssetManagerTest extends \PHPUnit\Framework\TestCase
self::assertObjectHasAttribute('assets', $manager); self::assertObjectHasAttribute('assets', $manager);
} }
public function testDefault() public function testDefault() : void
{ {
$manager = new AssetManager(); $manager = new AssetManager();
@ -37,7 +37,7 @@ class AssetManagerTest extends \PHPUnit\Framework\TestCase
self::assertEquals(0, $manager->count()); self::assertEquals(0, $manager->count());
} }
public function testSetGet() public function testSetGet() : void
{ {
$manager = new AssetManager(); $manager = new AssetManager();

View File

@ -19,7 +19,7 @@ use phpOMS\Asset\AssetType;
class AssetTypeTest extends \PHPUnit\Framework\TestCase class AssetTypeTest extends \PHPUnit\Framework\TestCase
{ {
public function testEnums() public function testEnums() : void
{ {
self::assertEquals(3, \count(AssetType::getConstants())); self::assertEquals(3, \count(AssetType::getConstants()));
self::assertEquals(0, AssetType::CSS); self::assertEquals(0, AssetType::CSS);

View File

@ -19,7 +19,7 @@ require_once __DIR__ . '/../Autoloader.php';
class AuthTest extends \PHPUnit\Framework\TestCase class AuthTest extends \PHPUnit\Framework\TestCase
{ {
public function testWithHttpSession() public function testWithHttpSession() : void
{ {
self::assertEquals(0, Auth::authenticate($GLOBALS['httpSession'])); self::assertEquals(0, Auth::authenticate($GLOBALS['httpSession']));

View File

@ -19,7 +19,7 @@ use phpOMS\Auth\LoginReturnType;
class LoginReturnTypeTest extends \PHPUnit\Framework\TestCase class LoginReturnTypeTest extends \PHPUnit\Framework\TestCase
{ {
public function testEnums() public function testEnums() : void
{ {
self::assertEquals(11, \count(LoginReturnType::getConstants())); self::assertEquals(11, \count(LoginReturnType::getConstants()));
self::assertEquals(0, LoginReturnType::OK); self::assertEquals(0, LoginReturnType::OK);

View File

@ -17,7 +17,7 @@ use phpOMS\AutoloadException;
class AutoloadExceptionTest extends \PHPUnit\Framework\TestCase class AutoloadExceptionTest extends \PHPUnit\Framework\TestCase
{ {
public function testException() public function testException() : void
{ {
self::assertInstanceOf(\RuntimeException::class, new AutoloadException('')); self::assertInstanceOf(\RuntimeException::class, new AutoloadException(''));
} }

View File

@ -17,7 +17,7 @@ use phpOMS\Autoloader;
class AutoloaderTest extends \PHPUnit\Framework\TestCase class AutoloaderTest extends \PHPUnit\Framework\TestCase
{ {
public function testAutoloader() public function testAutoloader() : void
{ {
self::assertTrue(Autoloader::exists('\phpOMS\Autoloader')); self::assertTrue(Autoloader::exists('\phpOMS\Autoloader'));
self::assertFalse(Autoloader::exists('\Does\Not\Exist')); self::assertFalse(Autoloader::exists('\Does\Not\Exist'));

View File

@ -17,7 +17,7 @@ use phpOMS\Business\Finance\Depreciation;
class DepreciationTest extends \PHPUnit\Framework\TestCase class DepreciationTest extends \PHPUnit\Framework\TestCase
{ {
public function testStraightLine() public function testStraightLine() : void
{ {
$start = 23280; $start = 23280;
$duration = 6; $duration = 6;
@ -27,7 +27,7 @@ class DepreciationTest extends \PHPUnit\Framework\TestCase
self::assertEquals(23280 - 3880 * $t, Depreciation::getStraightLineResidualInT($start, $duration, $t), '', 5); self::assertEquals(23280 - 3880 * $t, Depreciation::getStraightLineResidualInT($start, $duration, $t), '', 5);
} }
public function testArithmeticDegressivDepreciation() public function testArithmeticDegressivDepreciation() : void
{ {
$start = 150000; $start = 150000;
$residual = 18000; $residual = 18000;
@ -39,7 +39,7 @@ class DepreciationTest extends \PHPUnit\Framework\TestCase
self::assertEquals(70800, Depreciation::getArithmeticDegressivDepreciationResidualInT($start, $residual, $duration, $t), '', 5); self::assertEquals(70800, Depreciation::getArithmeticDegressivDepreciationResidualInT($start, $residual, $duration, $t), '', 5);
} }
public function testArithmeticProgressivDepreciation() public function testArithmeticProgressivDepreciation() : void
{ {
$start = 40000; $start = 40000;
$residual = 4700; $residual = 4700;
@ -51,7 +51,7 @@ class DepreciationTest extends \PHPUnit\Framework\TestCase
self::assertEquals(29410, Depreciation::getArithmeticProgressivDepreciationResidualInT($start, $residual, $duration, $t), '', 5); self::assertEquals(29410, Depreciation::getArithmeticProgressivDepreciationResidualInT($start, $residual, $duration, $t), '', 5);
} }
public function testGeometicProgressivDepreciation() public function testGeometicProgressivDepreciation() : void
{ {
$start = 150000; $start = 150000;
$residual = 18000; $residual = 18000;
@ -63,7 +63,7 @@ class DepreciationTest extends \PHPUnit\Framework\TestCase
self::assertEquals(125965, Depreciation::getGeometicProgressivDepreciationResidualInT($start, $residual, $duration, $t), '', 5); self::assertEquals(125965, Depreciation::getGeometicProgressivDepreciationResidualInT($start, $residual, $duration, $t), '', 5);
} }
public function testGeometicDegressivDepreciation() public function testGeometicDegressivDepreciation() : void
{ {
$start = 150000; $start = 150000;
$residual = 18000; $residual = 18000;

View File

@ -17,7 +17,7 @@ use phpOMS\Business\Finance\FinanceFormulas;
class FinanceFormulasTest extends \PHPUnit\Framework\TestCase class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
{ {
public function testAnnualPercentageYield() public function testAnnualPercentageYield() : void
{ {
$expected = 0.06168; $expected = 0.06168;
@ -29,7 +29,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
self::assertEquals(round($r, 2), FinanceFormulas::getStateAnnualInterestRateOfAPY($apy, $n)); self::assertEquals(round($r, 2), FinanceFormulas::getStateAnnualInterestRateOfAPY($apy, $n));
} }
public function testFutureValueOfAnnuity() public function testFutureValueOfAnnuity() : void
{ {
$expected = 5204.04; $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)); self::assertEquals(round($P, 2), \round(FinanceFormulas::getPeriodicPaymentOfFVA($fva, $r, $n), 2));
} }
public function testFutureValueOfAnnuityContinuousCompounding() public function testFutureValueOfAnnuityContinuousCompounding() : void
{ {
$expected = 12336.42; $expected = 12336.42;
@ -57,7 +57,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
self::assertEquals($t, FinanceFormulas::getTimeOfFVACC($fvacc, $cf, $r)); self::assertEquals($t, FinanceFormulas::getTimeOfFVACC($fvacc, $cf, $r));
} }
public function testAnnuityPaymentPV() public function testAnnuityPaymentPV() : void
{ {
$expected = 212.16; $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)); self::assertEquals(round($pv, 2), \round(FinanceFormulas::getPresentValueOfAPPV($p, $r, $n), 2));
} }
public function testAnnuityPaymentFV() public function testAnnuityPaymentFV() : void
{ {
$expected = 192.16; $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)); self::assertEquals(round($fv, 2), \round(FinanceFormulas::getFutureValueOfAPFV($p, $r, $n), 2));
} }
public function testAnnutiyPaymentFactorPV() public function testAnnutiyPaymentFactorPV() : void
{ {
$expected = 0.21216; $expected = 0.21216;
@ -97,7 +97,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
self::assertEquals($n, FinanceFormulas::getNumberOfAPFPV($p, $r)); self::assertEquals($n, FinanceFormulas::getNumberOfAPFPV($p, $r));
} }
public function testPresentValueOfAnnuity() public function testPresentValueOfAnnuity() : void
{ {
$expected = 4713.46; $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)); self::assertEquals(round($P, 2), \round(FinanceFormulas::getPeriodicPaymentOfPVA($pva, $r, $n), 2));
} }
public function testPresentValueAnnuityFactor() public function testPresentValueAnnuityFactor() : void
{ {
$expected = 4.7135; $expected = 4.7135;
@ -123,7 +123,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
self::assertEquals($n, FinanceFormulas::getPeriodsOfPVAF($p, $r)); self::assertEquals($n, FinanceFormulas::getPeriodsOfPVAF($p, $r));
} }
public function testPresentValueOfAnnuityDue() public function testPresentValueOfAnnuityDue() : void
{ {
$expected = 454.60; $expected = 454.60;
@ -138,7 +138,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
self::assertEquals($n, FinanceFormulas::getPeriodsOfPVAD($PV, $P, $r)); self::assertEquals($n, FinanceFormulas::getPeriodsOfPVAD($PV, $P, $r));
} }
public function testFutureValueOfAnnuityDue() public function testFutureValueOfAnnuityDue() : void
{ {
$expected = 580.19; $expected = 580.19;
@ -153,7 +153,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
self::assertEquals($n, FinanceFormulas::getPeriodsOfFVAD($FV, $P, $r)); 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::getRelativeMarketShareByShare(300, 400));
self::assertEquals(300 / 400, FinanceFormulas::getRelativeMarketShareBySales(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)); self::assertEquals(100 / 0.15, FinanceFormulas::getPresentValueOfPerpetuity(100, 0.15));
} }
public function testCompound() public function testCompound() : void
{ {
$expected = 15.76; $expected = 15.76;
@ -203,7 +203,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
self::assertEquals($t, (int) \round(FinanceFormulas::getPeriodsOfCompundInterest($P, $C, $r), 0)); self::assertEquals($t, (int) \round(FinanceFormulas::getPeriodsOfCompundInterest($P, $C, $r), 0));
} }
public function testContinuousCompounding() public function testContinuousCompounding() : void
{ {
$expected = 116.18; $expected = 116.18;
@ -219,7 +219,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
self::assertTrue(\abs($r - FinanceFormulas::getRateOfContinuousCompounding($P, $C, $t)) < 0.01); self::assertTrue(\abs($r - FinanceFormulas::getRateOfContinuousCompounding($P, $C, $t)) < 0.01);
} }
public function testSimpleInterest() public function testSimpleInterest() : void
{ {
$P = 100.00; $P = 100.00;
$r = 0.05; $r = 0.05;
@ -233,7 +233,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
self::assertEquals($t, FinanceFormulas::getSimpleInterestTime($I, $P, $r)); self::assertEquals($t, FinanceFormulas::getSimpleInterestTime($I, $P, $r));
} }
public function testDiscountedPaybackPeriod() public function testDiscountedPaybackPeriod() : void
{ {
$O1 = 5000; $O1 = 5000;
$r = 0.05; $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); self::assertTrue(\abs(5.896 - FinanceFormulas::getDiscountedPaybackPeriod($CF, $O1, $r)) < 0.01);
} }
public function testDoublingTime() public function testDoublingTime() : void
{ {
$r = 0.05; $r = 0.05;
@ -250,14 +250,14 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
self::assertTrue(\abs($r - FinanceFormulas::getDoublingRate(14.207)) < 0.01); self::assertTrue(\abs($r - FinanceFormulas::getDoublingRate(14.207)) < 0.01);
} }
public function testDoublingTimeContinuousCompounding() public function testDoublingTimeContinuousCompounding() : void
{ {
$r = 0.05; $r = 0.05;
self::assertEquals(13.863, FinanceFormulas::getDoublingTimeContinuousCompounding($r), '', 0.01); self::assertEquals(13.863, FinanceFormulas::getDoublingTimeContinuousCompounding($r), '', 0.01);
} }
public function testEquivalentAnnualAnnuity() public function testEquivalentAnnualAnnuity() : void
{ {
$npv = 1000; $npv = 1000;
$r = 0.15; $r = 0.15;
@ -268,7 +268,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
self::assertEquals($npv, FinanceFormulas::getNetPresentValueOfEAA(240.36, $r, $n), '', 0.01); self::assertEquals($npv, FinanceFormulas::getNetPresentValueOfEAA(240.36, $r, $n), '', 0.01);
} }
public function testFreeCashFlowToEquity() public function testFreeCashFlowToEquity() : void
{ {
$income = 1000; $income = 1000;
$depamo = 300; $depamo = 300;
@ -279,7 +279,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
self::assertEquals(1200, FinanceFormulas::getFreeCashFlowToEquity($income, $depamo, $capital, $wc, $borrowing), '', 0.01); self::assertEquals(1200, FinanceFormulas::getFreeCashFlowToEquity($income, $depamo, $capital, $wc, $borrowing), '', 0.01);
} }
public function testFreeCashFlowToFirm() public function testFreeCashFlowToFirm() : void
{ {
$ebit = 1000; $ebit = 1000;
$depamo = 300; $depamo = 300;
@ -290,7 +290,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
self::assertEquals(550, FinanceFormulas::getFreeCashFlowToFirm($ebit, $t, $depamo, $capital, $wc), '', 0.01); self::assertEquals(550, FinanceFormulas::getFreeCashFlowToFirm($ebit, $t, $depamo, $capital, $wc), '', 0.01);
} }
public function testFutureValue() public function testFutureValue() : void
{ {
$c = 1000; $c = 1000;
$r = 0.15; $r = 0.15;
@ -299,7 +299,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
self::assertEquals(2660.02, FinanceFormulas::getFutureValue($c, $r, $n), '', 0.01); self::assertEquals(2660.02, FinanceFormulas::getFutureValue($c, $r, $n), '', 0.01);
} }
public function testFutureValueContinuousCompounding() public function testFutureValueContinuousCompounding() : void
{ {
$pv = 1000; $pv = 1000;
$r = 0.15; $r = 0.15;
@ -308,7 +308,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
self::assertEquals(2857.65, FinanceFormulas::getFutureValueContinuousCompounding($pv, $r, $t), '', 0.01); self::assertEquals(2857.65, FinanceFormulas::getFutureValueContinuousCompounding($pv, $r, $t), '', 0.01);
} }
public function testValueFactor() public function testValueFactor() : void
{ {
$r = 0.15; $r = 0.15;
$n = 7; $n = 7;
@ -317,14 +317,14 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
self::assertEquals(0.37594, FinanceFormulas::getPresentValueFactor($r, $n), '', 0.01); 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]; $r = [0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07];
self::assertEquals(0.04123, FinanceFormulas::getGeometricMeanReturn($r), '', 0.01); self::assertEquals(0.04123, FinanceFormulas::getGeometricMeanReturn($r), '', 0.01);
} }
public function testGrowingAnnuityFV() public function testGrowingAnnuityFV() : void
{ {
$p = 1000; $p = 1000;
$r = 0.15; $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); self::assertEquals(14226.06, FinanceFormulas::getGrowingAnnuityFV($p, $r, $g, $n), '', 0.01);
} }
public function testGrowingAnnuityPaymentPV() public function testGrowingAnnuityPaymentPV() : void
{ {
$p = 1000; $p = 1000;
$r = 0.15; $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); self::assertEquals(186.98, FinanceFormulas::getGrowingAnnuityPaymentPV($p, $r, $g, $n), '', 0.01);
} }
public function testGrowingAnnuityPaymentFV() public function testGrowingAnnuityPaymentFV() : void
{ {
$fv = 1000; $fv = 1000;
$r = 0.15; $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); self::assertEquals(70.29, FinanceFormulas::getGrowingAnnuityPaymentFV($fv, $r, $g, $n), '', 0.01);
} }
public function testGrowingAnnuityPV() public function testGrowingAnnuityPV() : void
{ {
$p = 1000; $p = 1000;
$r = 0.15; $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); self::assertEquals(5348.1, FinanceFormulas::getGrowingAnnuityPV($p, $r, $g, $n), '', 0.01);
} }
public function testGrowingPerpetuityPV() public function testGrowingPerpetuityPV() : void
{ {
$d = 1000; $d = 1000;
$r = 0.15; $r = 0.15;
@ -373,7 +373,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
self::assertEquals(20000, FinanceFormulas::getGrowingPerpetuityPV($d, $r, $g), '', 0.01); 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]; $c = [1000, 100, 200, 300, 400, 500, 600];
$r = 0.15; $r = 0.15;
@ -384,12 +384,12 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \UnexpectedValueException * @expectedException \UnexpectedValueException
*/ */
public function testInvalidNetPresentValue() public function testInvalidNetPresentValue() : void
{ {
FinanceFormulas::getNetPresentValue([], 0.1); FinanceFormulas::getNetPresentValue([], 0.1);
} }
public function testRealRateOfReturn() public function testRealRateOfReturn() : void
{ {
$nominal = 0.15; $nominal = 0.15;
$inflation = 0.05; $inflation = 0.05;
@ -397,12 +397,12 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
self::assertEquals(0.09524, FinanceFormulas::getRealRateOfReturn($nominal, $inflation), '', 0.01); 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); self::assertEquals(1000 - 600, FinanceFormulas::getNetWorkingCapital(1000, 600), '', 0.01);
} }
public function testNumberOfPeriodsPVFV() public function testNumberOfPeriodsPVFV() : void
{ {
$fv = 1200; $fv = 1200;
$pv = 1000; $pv = 1000;
@ -411,7 +411,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
self::assertEquals(6.1681, FinanceFormulas::getNumberOfPeriodsPVFV($fv, $pv, $r), '', 0.01); self::assertEquals(6.1681, FinanceFormulas::getNumberOfPeriodsPVFV($fv, $pv, $r), '', 0.01);
} }
public function testPresentValue() public function testPresentValue() : void
{ {
$c = 1000; $c = 1000;
$r = 0.15; $r = 0.15;
@ -420,7 +420,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
self::assertEquals(375.94, FinanceFormulas::getPresentValue($c, $r, $n), '', 0.01); self::assertEquals(375.94, FinanceFormulas::getPresentValue($c, $r, $n), '', 0.01);
} }
public function testPresentValueContinuousCompounding() public function testPresentValueContinuousCompounding() : void
{ {
$c = 1000; $c = 1000;
$r = 0.15; $r = 0.15;

View File

@ -17,13 +17,13 @@ use phpOMS\Business\Finance\Loan;
class LoanTest extends \PHPUnit\Framework\TestCase 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::getLoanToDepositRatio(100, 50));
self::assertEquals(100 / 50, Loan::getLoanToValueRatio(100, 50)); self::assertEquals(100 / 50, Loan::getLoanToValueRatio(100, 50));
} }
public function testPaymentsOnBalloonLoan() public function testPaymentsOnBalloonLoan() : void
{ {
$pv = 1000; $pv = 1000;
$r = 0.15; $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); self::assertEquals(213.25, Loan::getPaymentsOnBalloonLoan($pv, $r, $n, $balloon), '', 0.01);
} }
public function testBalloonBalanceOfLoan() public function testBalloonBalanceOfLoan() : void
{ {
$pv = 1000; $pv = 1000;
$p = 300; $p = 300;
@ -43,7 +43,7 @@ class LoanTest extends \PHPUnit\Framework\TestCase
self::assertEquals(-660.02, Loan::getBalloonBalanceOfLoan($pv, $p, $r, $n), '', 0.01); self::assertEquals(-660.02, Loan::getBalloonBalanceOfLoan($pv, $p, $r, $n), '', 0.01);
} }
public function testLoanPayment() public function testLoanPayment() : void
{ {
$pv = 1000; $pv = 1000;
$r = 0.15; $r = 0.15;
@ -52,7 +52,7 @@ class LoanTest extends \PHPUnit\Framework\TestCase
self::assertEquals(240.36, Loan::getLoanPayment($pv, $r, $n), '', 0.01); self::assertEquals(240.36, Loan::getLoanPayment($pv, $r, $n), '', 0.01);
} }
public function testRemainingBalanceLoan() public function testRemainingBalanceLoan() : void
{ {
$pv = 1000; $pv = 1000;
$p = 200; $p = 200;

View File

@ -17,7 +17,7 @@ use phpOMS\Business\Finance\Lorenzkurve;
class LorenzkurveTest extends \PHPUnit\Framework\TestCase class LorenzkurveTest extends \PHPUnit\Framework\TestCase
{ {
public function testLorenz() public function testLorenz() : void
{ {
$arr = [1, 1, 1, 1, 1, 1, 1, 10, 33, 50]; $arr = [1, 1, 1, 1, 1, 1, 1, 10, 33, 50];

View File

@ -17,7 +17,7 @@ use phpOMS\Business\Finance\StockBonds;
class StockBondsTest extends \PHPUnit\Framework\TestCase 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::getBookValuePerShare(100, 50));
self::assertEquals(100 / 50, StockBonds::getCurrentYield(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)); 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); 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); 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); 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); 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]; $r = [0.01, 0.02, 0.03, 0.04];
self::assertEquals(0.10355, StockBonds::getHoldingPeriodReturn($r), '', 0.01); self::assertEquals(0.10355, StockBonds::getHoldingPeriodReturn($r), '', 0.01);
} }
public function testTaxEquivalentYield() public function testTaxEquivalentYield() : void
{ {
$free = 0.15; $free = 0.15;
$rate = 0.05; $rate = 0.05;
@ -66,7 +66,7 @@ class StockBondsTest extends \PHPUnit\Framework\TestCase
self::assertEquals(0.15789, StockBonds::getTaxEquivalentYield($free, $rate), '', 0.01); self::assertEquals(0.15789, StockBonds::getTaxEquivalentYield($free, $rate), '', 0.01);
} }
public function testNetAssetValue() public function testNetAssetValue() : void
{ {
$assets = 1000; $assets = 1000;
$liabilities = 300; $liabilities = 300;
@ -75,7 +75,7 @@ class StockBondsTest extends \PHPUnit\Framework\TestCase
self::assertEquals(1.75, StockBonds::getNetAssetValue($assets, $liabilities, $shares), '', 0.01); self::assertEquals(1.75, StockBonds::getNetAssetValue($assets, $liabilities, $shares), '', 0.01);
} }
public function testPresentValueOfStockConstantGrowth() public function testPresentValueOfStockConstantGrowth() : void
{ {
$div = 500; $div = 500;
$r = 0.15; $r = 0.15;
@ -84,7 +84,7 @@ class StockBondsTest extends \PHPUnit\Framework\TestCase
self::assertEquals(5000, StockBonds::getPresentValueOfStockConstantGrowth($div, $r, $g), '', 0.01); self::assertEquals(5000, StockBonds::getPresentValueOfStockConstantGrowth($div, $r, $g), '', 0.01);
} }
public function testTotalStockReturn() public function testTotalStockReturn() : void
{ {
$p0 = 1000; $p0 = 1000;
$p1 = 1200; $p1 = 1200;
@ -93,7 +93,7 @@ class StockBondsTest extends \PHPUnit\Framework\TestCase
self::assertEquals(0.3, StockBonds::getTotalStockReturn($p0, $p1, $d), '', 0.01); self::assertEquals(0.3, StockBonds::getTotalStockReturn($p0, $p1, $d), '', 0.01);
} }
public function testYieldToMaturity() public function testYieldToMaturity() : void
{ {
$c = 100; $c = 100;
$f = 1000; $f = 1000;
@ -103,7 +103,7 @@ class StockBondsTest extends \PHPUnit\Framework\TestCase
self::assertEquals(0.1138, StockBonds::getYieldToMaturity($c, $f, $p, $n), '', 0.01); self::assertEquals(0.1138, StockBonds::getYieldToMaturity($c, $f, $p, $n), '', 0.01);
} }
public function testZeroCouponBondValue() public function testZeroCouponBondValue() : void
{ {
$f = 100; $f = 100;
$r = 0.06; $r = 0.06;
@ -112,7 +112,7 @@ class StockBondsTest extends \PHPUnit\Framework\TestCase
self::assertEquals(74.73, StockBonds::getZeroCouponBondValue($f, $r, $t), '', 0.01); self::assertEquals(74.73, StockBonds::getZeroCouponBondValue($f, $r, $t), '', 0.01);
} }
public function testZeroCouponBondEffectiveYield() public function testZeroCouponBondEffectiveYield() : void
{ {
$f = 100; $f = 100;
$pv = 90; $pv = 90;

View File

@ -17,7 +17,7 @@ use phpOMS\Business\Marketing\Metrics;
class MetricsTest extends \PHPUnit\Framework\TestCase class MetricsTest extends \PHPUnit\Framework\TestCase
{ {
public function testMetrics() public function testMetrics() : void
{ {
self::assertTrue(0.85 - Metrics::getCustomerRetention(105, 20, 100) < 0.01); self::assertTrue(0.85 - Metrics::getCustomerRetention(105, 20, 100) < 0.01);
} }

View File

@ -17,14 +17,14 @@ use phpOMS\Business\Marketing\NetPromoterScore;
class NetPromoterScoreTest extends \PHPUnit\Framework\TestCase class NetPromoterScoreTest extends \PHPUnit\Framework\TestCase
{ {
public function testDefault() public function testDefault() : void
{ {
$nps = new NetPromoterScore(); $nps = new NetPromoterScore();
self::assertEquals(0, $nps->getScore()); self::assertEquals(0, $nps->getScore());
} }
public function testGetSet() public function testGetSet() : void
{ {
$nps = new NetPromoterScore(); $nps = new NetPromoterScore();

View File

@ -17,7 +17,7 @@ use phpOMS\Business\Programming\Metrics;
class MetricsTest extends \PHPUnit\Framework\TestCase 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)); self::assertEquals((int) \sqrt(5 * 5 + 11 * 11 + 9 * 9), Metrics::abcScore(5, 11, 9));

View File

@ -16,14 +16,14 @@ use phpOMS\Business\Sales\MarketShareEstimation;
class MarketShareEstimationTest extends \PHPUnit\Framework\TestCase class MarketShareEstimationTest extends \PHPUnit\Framework\TestCase
{ {
public function testZipfRank() public function testZipfRank() : void
{ {
self::assertEquals(13, MarketShareEstimation::getRankFromMarketShare(1000, 0.01)); self::assertEquals(13, MarketShareEstimation::getRankFromMarketShare(1000, 0.01));
self::assertEquals(19, MarketShareEstimation::getRankFromMarketShare(100, 0.01)); self::assertEquals(19, MarketShareEstimation::getRankFromMarketShare(100, 0.01));
self::assertEquals(8, MarketShareEstimation::getRankFromMarketShare(100000, 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(1000, 13)) < 0.01);
self::assertTrue(\abs(0.01 - MarketShareEstimation::getMarketShareFromRank(100, 19)) < 0.01); self::assertTrue(\abs(0.01 - MarketShareEstimation::getMarketShareFromRank(100, 19)) < 0.01);

View File

@ -20,7 +20,7 @@ require_once __DIR__ . '/../Autoloader.php';
class OptionsTraitTest extends \PHPUnit\Framework\TestCase class OptionsTraitTest extends \PHPUnit\Framework\TestCase
{ {
public function testOptionTrait() public function testOptionTrait() : void
{ {
$class = new class { $class = new class {
use OptionsTrait; use OptionsTrait;
@ -30,7 +30,7 @@ class OptionsTraitTest extends \PHPUnit\Framework\TestCase
self::assertObjectHasAttribute('options', $class); self::assertObjectHasAttribute('options', $class);
} }
public function testDefault() public function testDefault() : void
{ {
$class = new class { $class = new class {
use OptionsTrait; use OptionsTrait;
@ -40,7 +40,7 @@ class OptionsTraitTest extends \PHPUnit\Framework\TestCase
self::assertNull($class->getOption('someKey')); self::assertNull($class->getOption('someKey'));
} }
public function testSetGet() public function testSetGet() : void
{ {
$class = new class { $class = new class {
use OptionsTrait; use OptionsTrait;

View File

@ -18,7 +18,7 @@ use phpOMS\DataStorage\Cache\Connection\FileCache;
class CachePoolTest extends \PHPUnit\Framework\TestCase class CachePoolTest extends \PHPUnit\Framework\TestCase
{ {
public function testDefault() public function testDefault() : void
{ {
$pool = new CachePool(); $pool = new CachePool();
@ -26,7 +26,7 @@ class CachePoolTest extends \PHPUnit\Framework\TestCase
self::assertInstanceOf('\phpOMS\DataStorage\Cache\Connection\NullCache', $pool->get()); self::assertInstanceOf('\phpOMS\DataStorage\Cache\Connection\NullCache', $pool->get());
} }
public function testGetSet() public function testGetSet() : void
{ {
$pool = new CachePool(); $pool = new CachePool();

View File

@ -17,7 +17,7 @@ use phpOMS\DataStorage\Cache\CacheStatus;
class CacheStatusTest extends \PHPUnit\Framework\TestCase class CacheStatusTest extends \PHPUnit\Framework\TestCase
{ {
public function testEnums() public function testEnums() : void
{ {
self::assertEquals(4, \count(CacheStatus::getConstants())); self::assertEquals(4, \count(CacheStatus::getConstants()));
self::assertEquals(0, CacheStatus::OK); self::assertEquals(0, CacheStatus::OK);

View File

@ -17,7 +17,7 @@ use phpOMS\DataStorage\Cache\CacheType;
class CacheTypeTest extends \PHPUnit\Framework\TestCase class CacheTypeTest extends \PHPUnit\Framework\TestCase
{ {
public function testEnums() public function testEnums() : void
{ {
self::assertEquals(4, \count(CacheType::getConstants())); self::assertEquals(4, \count(CacheType::getConstants()));
self::assertEquals('file', CacheType::FILE); self::assertEquals('file', CacheType::FILE);

View File

@ -17,7 +17,7 @@ use phpOMS\DataStorage\Cache\Connection\CacheValueType;
class CacheValueTypeTest extends \PHPUnit\Framework\TestCase class CacheValueTypeTest extends \PHPUnit\Framework\TestCase
{ {
public function testEnums() public function testEnums() : void
{ {
self::assertEquals(8, \count(CacheValueType::getConstants())); self::assertEquals(8, \count(CacheValueType::getConstants()));
self::assertEquals(0, CacheValueType::_INT); self::assertEquals(0, CacheValueType::_INT);

View File

@ -18,7 +18,7 @@ use phpOMS\DataStorage\Cache\Connection\ConnectionFactory;
class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase
{ {
public function testCreateFileCache() public function testCreateFileCache() : void
{ {
self::assertInstanceOf( self::assertInstanceOf(
\phpOMS\DataStorage\Cache\Connection\FileCache::class, \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')) { if (!extension_loaded('memcached')) {
$this->markTestSkipped( $this->markTestSkipped(
@ -40,7 +40,7 @@ class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase
); );
} }
public function testCreateRedisCache() public function testCreateRedisCache() : void
{ {
if (!extension_loaded('redis')) { if (!extension_loaded('redis')) {
$this->markTestSkipped( $this->markTestSkipped(
@ -57,7 +57,7 @@ class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testInvalidCacheType() public function testInvalidCacheType() : void
{ {
ConnectionFactory::create(['type' => 'invalid', 'path' => 'Cache']); ConnectionFactory::create(['type' => 'invalid', 'path' => 'Cache']);
} }

View File

@ -22,7 +22,7 @@ class FileCacheJsonSerializable implements \JsonSerializable
return 'abc'; return 'abc';
} }
public function unserialize($val) public function unserialize($val) : void
{ {
$this->val = \json_decode($val, true); $this->val = \json_decode($val, true);
} }

View File

@ -22,7 +22,7 @@ class FileCacheSerializable implements \Serializable
return 'abc'; return 'abc';
} }
public function unserialize($val) public function unserialize($val) : void
{ {
$this->val = $val; $this->val = $val;
} }

View File

@ -20,7 +20,7 @@ use phpOMS\Utils\TestUtils;
class FileCacheTest extends \PHPUnit\Framework\TestCase class FileCacheTest extends \PHPUnit\Framework\TestCase
{ {
public function testDefault() public function testDefault() : void
{ {
if (\file_exists(__DIR__ . '/Cache')) { if (\file_exists(__DIR__ . '/Cache')) {
\rmdir(__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')) { if (\file_exists(__DIR__ . '/Cache')) {
\rmdir(__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')) { if (\file_exists(__DIR__ . '/Cache')) {
\rmdir(__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')) { if (\file_exists(__DIR__ . '/Cache')) {
\rmdir(__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')) { if (\file_exists(__DIR__ . '/Cache')) {
\rmdir(__DIR__ . '/Cache'); \rmdir(__DIR__ . '/Cache');
@ -198,7 +198,7 @@ class FileCacheTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException * @expectedException \phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException
*/ */
public function testInvalidCachePath() public function testInvalidCachePath() : void
{ {
$cache = new FileCache('/etc/invalidPathOrPermission^$:?><'); $cache = new FileCache('/etc/invalidPathOrPermission^$:?><');
} }

View File

@ -20,7 +20,7 @@ use phpOMS\Utils\TestUtils;
class MemCachedTest extends \PHPUnit\Framework\TestCase class MemCachedTest extends \PHPUnit\Framework\TestCase
{ {
protected function setUp() protected function setUp() : void
{ {
if (!extension_loaded('memcached')) { if (!extension_loaded('memcached')) {
$this->markTestSkipped( $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']); $cache = new MemCached($GLOBALS['CONFIG']['cache']['memcached']);
@ -40,7 +40,7 @@ class MemCachedTest extends \PHPUnit\Framework\TestCase
self::assertEquals(null, $cache->get('test')); self::assertEquals(null, $cache->get('test'));
} }
public function testConnect() public function testConnect() : void
{ {
$cache = new MemCached($GLOBALS['CONFIG']['cache']['memcached']); $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()); self::assertEquals((int) $GLOBALS['CONFIG']['cache']['memcached']['port'], $cache->getPort());
} }
public function testGetSet() public function testGetSet() : void
{ {
$cache = new MemCached($GLOBALS['CONFIG']['cache']['memcached']); $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 = new MemCached($GLOBALS['CONFIG']['cache']['memcached']);
$cache->flushAll(); $cache->flushAll();
@ -128,7 +128,7 @@ class MemCachedTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException * @expectedException \phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException
*/ */
public function testInvalidCacheHost() public function testInvalidCacheHost() : void
{ {
$db = $GLOBALS['CONFIG']['cache']['memcached']; $db = $GLOBALS['CONFIG']['cache']['memcached'];
unset($db['host']); unset($db['host']);
@ -139,7 +139,7 @@ class MemCachedTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException * @expectedException \phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException
*/ */
public function testInvalidCachePort() public function testInvalidCachePort() : void
{ {
$db = $GLOBALS['CONFIG']['cache']['memcached']; $db = $GLOBALS['CONFIG']['cache']['memcached'];
unset($db['port']); unset($db['port']);

View File

@ -18,7 +18,7 @@ use phpOMS\DataStorage\Cache\Connection\NullCache;
class NullCacheTest extends \PHPUnit\Framework\TestCase class NullCacheTest extends \PHPUnit\Framework\TestCase
{ {
public function testCache() public function testCache() : void
{ {
$cache = new NullCache(); $cache = new NullCache();
$cache->connect([]); $cache->connect([]);

View File

@ -20,7 +20,7 @@ use phpOMS\Utils\TestUtils;
class RedisCacheTest extends \PHPUnit\Framework\TestCase class RedisCacheTest extends \PHPUnit\Framework\TestCase
{ {
protected function setUp() protected function setUp() : void
{ {
if (!extension_loaded('redis')) { if (!extension_loaded('redis')) {
$this->markTestSkipped( $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']); $cache = new RedisCache($GLOBALS['CONFIG']['cache']['redis']);
@ -41,7 +41,7 @@ class RedisCacheTest extends \PHPUnit\Framework\TestCase
self::assertEquals(null, $cache->get('test')); self::assertEquals(null, $cache->get('test'));
} }
public function testConnect() public function testConnect() : void
{ {
$cache = new RedisCache($GLOBALS['CONFIG']['cache']['redis']); $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()); self::assertEquals((int) $GLOBALS['CONFIG']['cache']['redis']['port'], $cache->getPort());
} }
public function testGetSet() public function testGetSet() : void
{ {
$cache = new RedisCache($GLOBALS['CONFIG']['cache']['redis']); $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 = new RedisCache($GLOBALS['CONFIG']['cache']['redis']);
$cache->flushAll(); $cache->flushAll();
@ -130,7 +130,7 @@ class RedisCacheTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException * @expectedException \phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException
*/ */
public function testInvalidCacheHost() public function testInvalidCacheHost() : void
{ {
$db = $GLOBALS['CONFIG']['cache']['redis']; $db = $GLOBALS['CONFIG']['cache']['redis'];
unset($db['host']); unset($db['host']);
@ -141,7 +141,7 @@ class RedisCacheTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException * @expectedException \phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException
*/ */
public function testInvalidCachePort() public function testInvalidCachePort() : void
{ {
$db = $GLOBALS['CONFIG']['cache']['redis']; $db = $GLOBALS['CONFIG']['cache']['redis'];
unset($db['port']); unset($db['port']);
@ -152,7 +152,7 @@ class RedisCacheTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException * @expectedException \phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException
*/ */
public function testInvalidCacheDatabase() public function testInvalidCacheDatabase() : void
{ {
$db = $GLOBALS['CONFIG']['cache']['redis']; $db = $GLOBALS['CONFIG']['cache']['redis'];
unset($db['db']); unset($db['db']);

View File

@ -17,7 +17,7 @@ use phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException;
class InvalidConnectionConfigExceptionTest extends \PHPUnit\Framework\TestCase class InvalidConnectionConfigExceptionTest extends \PHPUnit\Framework\TestCase
{ {
public function testException() public function testException() : void
{ {
self::assertInstanceOf(\InvalidArgumentException::class, new InvalidConnectionConfigException('')); self::assertInstanceOf(\InvalidArgumentException::class, new InvalidConnectionConfigException(''));
} }

View File

@ -17,7 +17,7 @@ use phpOMS\DataStorage\Cookie\CookieJar;
class CookieJarTest extends \PHPUnit\Framework\TestCase class CookieJarTest extends \PHPUnit\Framework\TestCase
{ {
public function testDefault() public function testDefault() : void
{ {
$jar = new CookieJar(); $jar = new CookieJar();
@ -26,7 +26,7 @@ class CookieJarTest extends \PHPUnit\Framework\TestCase
self::assertFalse($jar->delete('asd')); self::assertFalse($jar->delete('asd'));
} }
public function testCookie() public function testCookie() : void
{ {
$jar = new CookieJar(); $jar = new CookieJar();
@ -46,7 +46,7 @@ class CookieJarTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\LockException * @expectedException \phpOMS\DataStorage\LockException
*/ */
public function testDeleteLocked() public function testDeleteLocked() : void
{ {
$jar = new CookieJar(); $jar = new CookieJar();
self::assertTrue($jar->set('test', 'value')); self::assertTrue($jar->set('test', 'value'));
@ -58,7 +58,7 @@ class CookieJarTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\LockException * @expectedException \phpOMS\DataStorage\LockException
*/ */
public function testSaveLocked() public function testSaveLocked() : void
{ {
CookieJar::lock(); CookieJar::lock();

View File

@ -21,7 +21,7 @@ use phpOMS\DataStorage\Database\Connection\SqlServerConnection;
class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase
{ {
public function testCreateMysql() public function testCreateMysql() : void
{ {
if (!extension_loaded('pdo_mysql')) { if (!extension_loaded('pdo_mysql')) {
$this->markTestSkipped( $this->markTestSkipped(
@ -37,7 +37,7 @@ class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase
); );
} }
public function testCreatePostgres() public function testCreatePostgres() : void
{ {
if (!extension_loaded('pdo_pgsql')) { if (!extension_loaded('pdo_pgsql')) {
$this->markTestSkipped( $this->markTestSkipped(
@ -53,7 +53,7 @@ class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase
); );
} }
public function testCreateSqlsrv() public function testCreateSqlsrv() : void
{ {
if (!extension_loaded('pdo_sqlsrv')) { if (!extension_loaded('pdo_sqlsrv')) {
$this->markTestSkipped( $this->markTestSkipped(
@ -69,7 +69,7 @@ class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase
); );
} }
public function testCreateSqlite() public function testCreateSqlite() : void
{ {
if (!extension_loaded('pdo_sqlite')) { if (!extension_loaded('pdo_sqlite')) {
$this->markTestSkipped( $this->markTestSkipped(
@ -88,7 +88,7 @@ class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testInvalidDatabaseType() public function testInvalidDatabaseType() : void
{ {
ConnectionFactory::create(['db' => 'invalid']); ConnectionFactory::create(['db' => 'invalid']);
} }

View File

@ -18,7 +18,7 @@ use phpOMS\DataStorage\Database\DatabaseStatus;
class MysqlConnectionTest extends \PHPUnit\Framework\TestCase class MysqlConnectionTest extends \PHPUnit\Framework\TestCase
{ {
protected function setUp() protected function setUp() : void
{ {
if (!extension_loaded('pdo_mysql')) { if (!extension_loaded('pdo_mysql')) {
$this->markTestSkipped( $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']); $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 * @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
*/ */
public function testInvalidDatabaseType() public function testInvalidDatabaseType() : void
{ {
$db = $GLOBALS['CONFIG']['db']['core']['masters']['admin']; $db = $GLOBALS['CONFIG']['db']['core']['masters']['admin'];
unset($db['db']); unset($db['db']);
@ -52,7 +52,7 @@ class MysqlConnectionTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException * @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
*/ */
public function testInvalidHost() public function testInvalidHost() : void
{ {
$db = $GLOBALS['CONFIG']['db']['core']['masters']['admin']; $db = $GLOBALS['CONFIG']['db']['core']['masters']['admin'];
unset($db['host']); unset($db['host']);
@ -63,7 +63,7 @@ class MysqlConnectionTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException * @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
*/ */
public function testInvalidPort() public function testInvalidPort() : void
{ {
$db = $GLOBALS['CONFIG']['db']['core']['masters']['admin']; $db = $GLOBALS['CONFIG']['db']['core']['masters']['admin'];
unset($db['port']); unset($db['port']);
@ -74,7 +74,7 @@ class MysqlConnectionTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException * @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
*/ */
public function testInvalidDatabase() public function testInvalidDatabase() : void
{ {
$db = $GLOBALS['CONFIG']['db']['core']['masters']['admin']; $db = $GLOBALS['CONFIG']['db']['core']['masters']['admin'];
unset($db['database']); unset($db['database']);
@ -85,7 +85,7 @@ class MysqlConnectionTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException * @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
*/ */
public function testInvalidLogin() public function testInvalidLogin() : void
{ {
$db = $GLOBALS['CONFIG']['db']['core']['masters']['admin']; $db = $GLOBALS['CONFIG']['db']['core']['masters']['admin'];
unset($db['login']); unset($db['login']);
@ -96,7 +96,7 @@ class MysqlConnectionTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException * @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
*/ */
public function testInvalidPassword() public function testInvalidPassword() : void
{ {
$db = $GLOBALS['CONFIG']['db']['core']['masters']['admin']; $db = $GLOBALS['CONFIG']['db']['core']['masters']['admin'];
unset($db['password']); unset($db['password']);
@ -107,7 +107,7 @@ class MysqlConnectionTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException * @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
*/ */
public function testInvalidDatabaseTypeName() public function testInvalidDatabaseTypeName() : void
{ {
$db = $GLOBALS['CONFIG']['db']['core']['masters']['admin']; $db = $GLOBALS['CONFIG']['db']['core']['masters']['admin'];
$db['db'] = 'invalid'; $db['db'] = 'invalid';
@ -118,7 +118,7 @@ class MysqlConnectionTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException * @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
*/ */
public function testInvalidDatabaseName() public function testInvalidDatabaseName() : void
{ {
$db = $GLOBALS['CONFIG']['db']['core']['masters']['admin']; $db = $GLOBALS['CONFIG']['db']['core']['masters']['admin'];
$db['database'] = 'invalid'; $db['database'] = 'invalid';

View File

@ -18,7 +18,7 @@ use phpOMS\DataStorage\Database\DatabaseType;
class NullConnectionTest extends \PHPUnit\Framework\TestCase class NullConnectionTest extends \PHPUnit\Framework\TestCase
{ {
public function testConnect() public function testConnect() : void
{ {
$null = new NullConnection([]); $null = new NullConnection([]);
$null->connect(); $null->connect();

View File

@ -17,7 +17,7 @@ use phpOMS\DataStorage\Database\DatabaseStatus;
class PostgresConnectionTest extends \PHPUnit\Framework\TestCase class PostgresConnectionTest extends \PHPUnit\Framework\TestCase
{ {
protected function setUp() protected function setUp() : void
{ {
if (!extension_loaded('pdo_pgsql')) { if (!extension_loaded('pdo_pgsql')) {
$this->markTestSkipped( $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']); $psql = new PostgresConnection($GLOBALS['CONFIG']['db']['core']['postgresql']['admin']);
self::assertEquals(DatabaseStatus::OK, $psql->getStatus()); self::assertEquals(DatabaseStatus::OK, $psql->getStatus());
@ -39,7 +39,7 @@ class PostgresConnectionTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException * @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
*/ */
public function testInvalidDatabaseType() public function testInvalidDatabaseType() : void
{ {
$db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin']; $db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin'];
unset($db['db']); unset($db['db']);
@ -49,7 +49,7 @@ class PostgresConnectionTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException * @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
*/ */
public function testInvalidHost() public function testInvalidHost() : void
{ {
$db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin']; $db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin'];
unset($db['host']); unset($db['host']);
@ -59,7 +59,7 @@ class PostgresConnectionTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException * @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
*/ */
public function testInvalidPort() public function testInvalidPort() : void
{ {
$db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin']; $db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin'];
unset($db['port']); unset($db['port']);
@ -69,7 +69,7 @@ class PostgresConnectionTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException * @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
*/ */
public function testInvalidDatabase() public function testInvalidDatabase() : void
{ {
$db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin']; $db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin'];
unset($db['database']); unset($db['database']);
@ -79,7 +79,7 @@ class PostgresConnectionTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException * @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
*/ */
public function testInvalidLogin() public function testInvalidLogin() : void
{ {
$db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin']; $db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin'];
unset($db['login']); unset($db['login']);
@ -89,7 +89,7 @@ class PostgresConnectionTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException * @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
*/ */
public function testInvalidPassword() public function testInvalidPassword() : void
{ {
$db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin']; $db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin'];
unset($db['password']); unset($db['password']);
@ -99,7 +99,7 @@ class PostgresConnectionTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException * @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
*/ */
public function testInvalidDatabaseTypeName() public function testInvalidDatabaseTypeName() : void
{ {
$db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin']; $db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin'];
$db['db'] = 'invalid'; $db['db'] = 'invalid';
@ -109,7 +109,7 @@ class PostgresConnectionTest extends \PHPUnit\Framework\TestCase
/** /**
* todo: apparently this doesn't throw an exception in postgresql?! * 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 = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin'];
$db['database'] = 'invalid'; $db['database'] = 'invalid';

View File

@ -17,7 +17,7 @@ use phpOMS\DataStorage\Database\DatabaseStatus;
class SQLiteConnectionTest extends \PHPUnit\Framework\TestCase class SQLiteConnectionTest extends \PHPUnit\Framework\TestCase
{ {
protected function setUp() protected function setUp() : void
{ {
if (!extension_loaded('pdo_sqlite')) { if (!extension_loaded('pdo_sqlite')) {
$this->markTestSkipped( $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']); $sqlite = new SQLiteConnection($GLOBALS['CONFIG']['db']['core']['sqlite']['admin']);
self::assertEquals(DatabaseStatus::OK, $sqlite->getStatus()); self::assertEquals(DatabaseStatus::OK, $sqlite->getStatus());
@ -37,7 +37,7 @@ class SQLiteConnectionTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException * @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
*/ */
public function testInvalidDatabaseType() public function testInvalidDatabaseType() : void
{ {
$db = $GLOBALS['CONFIG']['db']['core']['sqlite']['admin']; $db = $GLOBALS['CONFIG']['db']['core']['sqlite']['admin'];
unset($db['db']); unset($db['db']);
@ -47,14 +47,14 @@ class SQLiteConnectionTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException * @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
*/ */
public function testInvalidDatabase() public function testInvalidDatabase() : void
{ {
$db = $GLOBALS['CONFIG']['db']['core']['sqlite']['admin']; $db = $GLOBALS['CONFIG']['db']['core']['sqlite']['admin'];
unset($db['database']); unset($db['database']);
$sqlite = new SQLiteConnection($db); $sqlite = new SQLiteConnection($db);
} }
static function tearDownAfterClass() public static function tearDownAfterClass() : void
{ {
if (\file_exists($GLOBALS['CONFIG']['db']['core']['sqlite']['admin']['database'])) { if (\file_exists($GLOBALS['CONFIG']['db']['core']['sqlite']['admin']['database'])) {
\unlink($GLOBALS['CONFIG']['db']['core']['sqlite']['admin']['database']); \unlink($GLOBALS['CONFIG']['db']['core']['sqlite']['admin']['database']);

View File

@ -17,7 +17,7 @@ use phpOMS\DataStorage\Database\Connection\SqlServerConnection;
class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase
{ {
protected function setUp() protected function setUp() : void
{ {
if (!extension_loaded('pdo_sqlsrv')) { if (!extension_loaded('pdo_sqlsrv')) {
$this->markTestSkipped( $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']); $psql = new SqlServerConnection($GLOBALS['CONFIG']['db']['core']['mssql']['admin']);
self::assertEquals(DatabaseStatus::OK, $psql->getStatus()); self::assertEquals(DatabaseStatus::OK, $psql->getStatus());
@ -39,7 +39,7 @@ class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException * @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
*/ */
public function testInvalidDatabaseType() public function testInvalidDatabaseType() : void
{ {
$db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin']; $db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin'];
unset($db['db']); unset($db['db']);
@ -49,7 +49,7 @@ class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException * @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
*/ */
public function testInvalidHost() public function testInvalidHost() : void
{ {
$db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin']; $db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin'];
unset($db['host']); unset($db['host']);
@ -59,7 +59,7 @@ class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException * @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
*/ */
public function testInvalidPort() public function testInvalidPort() : void
{ {
$db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin']; $db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin'];
unset($db['port']); unset($db['port']);
@ -69,7 +69,7 @@ class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException * @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
*/ */
public function testInvalidDatabase() public function testInvalidDatabase() : void
{ {
$db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin']; $db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin'];
unset($db['database']); unset($db['database']);
@ -79,7 +79,7 @@ class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException * @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
*/ */
public function testInvalidLogin() public function testInvalidLogin() : void
{ {
$db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin']; $db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin'];
unset($db['login']); unset($db['login']);
@ -89,7 +89,7 @@ class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException * @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
*/ */
public function testInvalidPassword() public function testInvalidPassword() : void
{ {
$db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin']; $db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin'];
unset($db['password']); unset($db['password']);
@ -99,7 +99,7 @@ class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException * @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
*/ */
public function testInvalidDatabaseTypeName() public function testInvalidDatabaseTypeName() : void
{ {
$db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin']; $db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin'];
$db['db'] = 'invalid'; $db['db'] = 'invalid';
@ -109,7 +109,7 @@ class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException * @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException
*/ */
public function testInvalidDatabaseName() public function testInvalidDatabaseName() : void
{ {
$db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin']; $db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin'];
$db['database'] = 'invalid'; $db['database'] = 'invalid';

View File

@ -23,7 +23,7 @@ class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase
protected $model = null; protected $model = null;
protected $modelArray = null; protected $modelArray = null;
protected function setUp() protected function setUp() : void
{ {
$this->model = new BaseModel(); $this->model = new BaseModel();
$this->modelArray = [ $this->modelArray = [
@ -133,7 +133,7 @@ class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase
)->execute(); )->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_base')->execute();
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE oms_test_belongs_to_one')->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(); $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_id', BaseModelMapper::getPrimaryField());
self::assertEquals('test_base', BaseModelMapper::getTable()); self::assertEquals('test_base', BaseModelMapper::getTable());
self::assertEquals('test_base_datetime', BaseModelMapper::getCreatedAt()); self::assertEquals('test_base_datetime', BaseModelMapper::getCreatedAt());
} }
public function testCreate() public function testCreate() : void
{ {
self::assertGreaterThan(0, BaseModelMapper::create($this->model)); self::assertGreaterThan(0, BaseModelMapper::create($this->model));
self::assertGreaterThan(0, $this->model->id); self::assertGreaterThan(0, $this->model->id);
} }
public function testCreateArray() public function testCreateArray() : void
{ {
self::assertGreaterThan(0, BaseModelMapper::createArray($this->modelArray)); self::assertGreaterThan(0, BaseModelMapper::createArray($this->modelArray));
self::assertGreaterThan(0, $this->modelArray['id']); self::assertGreaterThan(0, $this->modelArray['id']);
} }
public function testRead() public function testRead() : void
{ {
$id = BaseModelMapper::create($this->model); $id = BaseModelMapper::create($this->model);
$modelR = BaseModelMapper::get($id); $modelR = BaseModelMapper::get($id);
@ -193,7 +193,7 @@ class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase
self::assertEquals(1, count(BaseModelMapper::getAll())); self::assertEquals(1, count(BaseModelMapper::getAll()));
} }
public function testReadArray() public function testReadArray() : void
{ {
$id = BaseModelMapper::createArray($this->modelArray); $id = BaseModelMapper::createArray($this->modelArray);
$modelR = BaseModelMapper::getArray($id); $modelR = BaseModelMapper::getArray($id);
@ -219,7 +219,7 @@ class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase
self::assertEquals(1, count(BaseModelMapper::getAllArray())); self::assertEquals(1, count(BaseModelMapper::getAllArray()));
} }
public function testUpdate() public function testUpdate() : void
{ {
$id = BaseModelMapper::create($this->model); $id = BaseModelMapper::create($this->model);
$modelR = BaseModelMapper::get($id); $modelR = BaseModelMapper::get($id);
@ -244,7 +244,7 @@ class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase
// todo test update relations // todo test update relations
} }
public function testUpdateArray() public function testUpdateArray() : void
{ {
$id = BaseModelMapper::createArray($this->modelArray); $id = BaseModelMapper::createArray($this->modelArray);
$modelR = BaseModelMapper::getArray($id); $modelR = BaseModelMapper::getArray($id);
@ -269,7 +269,7 @@ class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase
// todo test update relations // todo test update relations
} }
public function testDelete() public function testDelete() : void
{ {
$id = BaseModelMapper::create($this->model); $id = BaseModelMapper::create($this->model);
BaseModelMapper::delete($this->model); BaseModelMapper::delete($this->model);

View File

@ -17,12 +17,12 @@ use phpOMS\DataStorage\Database\DatabaseExceptionFactory;
class DatabaseExceptionFactoryTest extends \PHPUnit\Framework\TestCase class DatabaseExceptionFactoryTest extends \PHPUnit\Framework\TestCase
{ {
public function testException() public function testException() : void
{ {
self::assertEquals('\PDOException', DatabaseExceptionFactory::createException(new \PDOException())); self::assertEquals('\PDOException', DatabaseExceptionFactory::createException(new \PDOException()));
} }
public function testExceptionMessage() public function testExceptionMessage() : void
{ {
self::assertEquals('', DatabaseExceptionFactory::createExceptionMessage(new \PDOException())); self::assertEquals('', DatabaseExceptionFactory::createExceptionMessage(new \PDOException()));
} }

View File

@ -19,7 +19,7 @@ use phpOMS\DataStorage\Database\DatabaseStatus;
class DatabasePoolTest extends \PHPUnit\Framework\TestCase class DatabasePoolTest extends \PHPUnit\Framework\TestCase
{ {
public function testBasicConnection() public function testBasicConnection() : void
{ {
$dbPool = new DatabasePool(); $dbPool = new DatabasePool();
/** @var array $CONFIG */ /** @var array $CONFIG */
@ -28,7 +28,7 @@ class DatabasePoolTest extends \PHPUnit\Framework\TestCase
self::assertEquals($dbPool->get()->getStatus(), DatabaseStatus::OK); self::assertEquals($dbPool->get()->getStatus(), DatabaseStatus::OK);
} }
public function testGetSet() public function testGetSet() : void
{ {
$dbPool = new DatabasePool(); $dbPool = new DatabasePool();
/** @var array $CONFIG */ /** @var array $CONFIG */

View File

@ -17,7 +17,7 @@ use phpOMS\DataStorage\Database\DatabaseStatus;
class DatabaseStatusTest extends \PHPUnit\Framework\TestCase class DatabaseStatusTest extends \PHPUnit\Framework\TestCase
{ {
public function testEnums() public function testEnums() : void
{ {
self::assertEquals(6, \count(DatabaseStatus::getConstants())); self::assertEquals(6, \count(DatabaseStatus::getConstants()));
self::assertEquals(0, DatabaseStatus::OK); self::assertEquals(0, DatabaseStatus::OK);

View File

@ -17,7 +17,7 @@ use phpOMS\DataStorage\Database\DatabaseType;
class DatabaseTypeTest extends \PHPUnit\Framework\TestCase class DatabaseTypeTest extends \PHPUnit\Framework\TestCase
{ {
public function testEnums() public function testEnums() : void
{ {
self::assertEquals(5, \count(DatabaseType::getConstants())); self::assertEquals(5, \count(DatabaseType::getConstants()));
self::assertEquals('mysql', DatabaseType::MYSQL); self::assertEquals('mysql', DatabaseType::MYSQL);

View File

@ -17,7 +17,7 @@ use phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException;
class InvalidConnectionConfigExceptionTest extends \PHPUnit\Framework\TestCase class InvalidConnectionConfigExceptionTest extends \PHPUnit\Framework\TestCase
{ {
public function testException() public function testException() : void
{ {
self::assertInstanceOf(\InvalidArgumentException::class, new InvalidConnectionConfigException('')); self::assertInstanceOf(\InvalidArgumentException::class, new InvalidConnectionConfigException(''));
} }

View File

@ -17,7 +17,7 @@ use phpOMS\DataStorage\Database\Exception\InvalidDatabaseTypeException;
class InvalidDatabaseTypeExceptionTest extends \PHPUnit\Framework\TestCase class InvalidDatabaseTypeExceptionTest extends \PHPUnit\Framework\TestCase
{ {
public function testException() public function testException() : void
{ {
self::assertInstanceOf(\InvalidArgumentException::class, new InvalidDatabaseTypeException('')); self::assertInstanceOf(\InvalidArgumentException::class, new InvalidDatabaseTypeException(''));
} }

View File

@ -17,7 +17,7 @@ use phpOMS\DataStorage\Database\Exception\InvalidMapperException;
class InvalidMapperExceptionTest extends \PHPUnit\Framework\TestCase class InvalidMapperExceptionTest extends \PHPUnit\Framework\TestCase
{ {
public function testException() public function testException() : void
{ {
self::assertInstanceOf(\RuntimeException::class, new InvalidMapperException('')); self::assertInstanceOf(\RuntimeException::class, new InvalidMapperException(''));
} }

View File

@ -20,12 +20,12 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
{ {
protected $con = null; protected $con = null;
protected function setUp() protected function setUp() : void
{ {
$this->con = new MysqlConnection($GLOBALS['CONFIG']['db']['core']['masters']['admin']); $this->con = new MysqlConnection($GLOBALS['CONFIG']['db']['core']['masters']['admin']);
} }
public function testMysqlSelect() public function testMysqlSelect() : void
{ {
$query = new Builder($this->con); $query = new Builder($this->con);
$sql = 'SELECT `a`.`test` FROM `a` WHERE `a`.`test` = 1;'; $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); $query = new Builder($this->con);
$sql = 'SELECT `a`.`test` FROM `a` WHERE `a`.`test` = 1 ORDER BY `a`.`test` DESC;'; $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()); 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); $query = new Builder($this->con);
$sql = 'SELECT `a`.`test` FROM `a` WHERE `a`.`test` = 1 LIMIT 3;'; $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()); 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); $query = new Builder($this->con);
$sql = 'SELECT `a`.`test` FROM `a` WHERE `a`.`test` = 1 GROUP BY `a`;'; $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()); 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); $query = new Builder($this->con);
$sql = 'SELECT `a`.`test` FROM `a` WHERE `a`.`test` = 1;'; $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()); 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); $query = new Builder($this->con);
$sql = 'SELECT `a`.`test` FROM `a` JOIN `b` ON `a`.`id` = `b`.`id` WHERE `a`.`test` = 1;'; $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()); 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); $query = new Builder($this->con);
$sql = 'INSERT INTO `a` VALUES (1, \'test\');'; $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()); 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); $query = new Builder($this->con);
$sql = 'DELETE FROM `a` WHERE `a`.`test` = 1;'; $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()); self::assertEquals($sql, $query->delete()->from('a')->where('a.test', '=', ':testVal')->toSql());
} }
public function testMysqlUpdate() public function testMysqlUpdate() : void
{ {
$query = new Builder($this->con); $query = new Builder($this->con);
$sql = 'UPDATE `a` SET `a`.`test` = 1, `a`.`test2` = 2 WHERE `a`.`test` = 1;'; $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()); 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); $query = new Builder($this->con);
self::assertEquals('SELECT test.val FROM test;', $query->raw('SELECT test.val FROM test;')->toSql()); 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 * @expectedException \Exception
*/ */
public function testReadOnlyRaw() public function testReadOnlyRaw() : void
{ {
$query = new Builder($this->con, true); $query = new Builder($this->con, true);
$query->raw('DROP DATABASE oms;'); $query->raw('DROP DATABASE oms;');
@ -316,7 +316,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \Exception * @expectedException \Exception
*/ */
public function testReadOnlyInsert() public function testReadOnlyInsert() : void
{ {
$query = new Builder($this->con, true); $query = new Builder($this->con, true);
$query->insert('test'); $query->insert('test');
@ -325,7 +325,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \Exception * @expectedException \Exception
*/ */
public function testReadOnlyUpdate() public function testReadOnlyUpdate() : void
{ {
$query = new Builder($this->con, true); $query = new Builder($this->con, true);
$query->update(); $query->update();
@ -334,7 +334,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \Exception * @expectedException \Exception
*/ */
public function testReadOnlyDelete() public function testReadOnlyDelete() : void
{ {
$query = new Builder($this->con, true); $query = new Builder($this->con, true);
$query->delete(); $query->delete();
@ -343,7 +343,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testInvalidWhereOperator() public function testInvalidWhereOperator() : void
{ {
$query = new Builder($this->con, true); $query = new Builder($this->con, true);
$query->where('a', 'invalid', 'b'); $query->where('a', 'invalid', 'b');
@ -352,7 +352,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testInvalidJoinTable() public function testInvalidJoinTable() : void
{ {
$query = new Builder($this->con, true); $query = new Builder($this->con, true);
$query->join(null); $query->join(null);
@ -361,7 +361,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testInvalidJoinOperator() public function testInvalidJoinOperator() : void
{ {
$query = new Builder($this->con, true); $query = new Builder($this->con, true);
$query->join('b')->on('a', 'invalid', 'b'); $query->join('b')->on('a', 'invalid', 'b');
@ -370,7 +370,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testInvalidOrOrderType() public function testInvalidOrOrderType() : void
{ {
$query = new Builder($this->con, true); $query = new Builder($this->con, true);
$query->orderBy('a', 1); $query->orderBy('a', 1);
@ -379,7 +379,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
/** /**
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testInvalidOrColumnType() public function testInvalidOrColumnType() : void
{ {
$query = new Builder($this->con, true); $query = new Builder($this->con, true);
$query->orderBy(null, 'DESC'); $query->orderBy(null, 'DESC');

View File

@ -16,7 +16,7 @@ namespace phpOMS\tests\DataStorage\Database\Query;
class ColumnTest extends \PHPUnit\Framework\TestCase class ColumnTest extends \PHPUnit\Framework\TestCase
{ {
public function testPlaceholder() public function testPlaceholder() : void
{ {
self::markTestIncomplete(); self::markTestIncomplete();
} }

View File

@ -16,7 +16,7 @@ namespace phpOMS\tests\DataStorage\Database\Query;
class CountTest extends \PHPUnit\Framework\TestCase class CountTest extends \PHPUnit\Framework\TestCase
{ {
public function testPlaceholder() public function testPlaceholder() : void
{ {
self::markTestIncomplete(); self::markTestIncomplete();
} }

View File

@ -16,7 +16,7 @@ namespace phpOMS\tests\DataStorage\Database\Query;
class ExpressionTest extends \PHPUnit\Framework\TestCase class ExpressionTest extends \PHPUnit\Framework\TestCase
{ {
public function testPlaceholder() public function testPlaceholder() : void
{ {
self::markTestIncomplete(); self::markTestIncomplete();
} }

View File

@ -16,7 +16,7 @@ namespace phpOMS\tests\DataStorage\Database\Query;
class FromTest extends \PHPUnit\Framework\TestCase class FromTest extends \PHPUnit\Framework\TestCase
{ {
public function testPlaceholder() public function testPlaceholder() : void
{ {
self::markTestIncomplete(); self::markTestIncomplete();
} }

View File

@ -17,7 +17,7 @@ use phpOMS\DataStorage\Database\Query\Grammar\Grammar;
class GrammarTest extends \PHPUnit\Framework\TestCase class GrammarTest extends \PHPUnit\Framework\TestCase
{ {
public function testDefault() public function testDefault() : void
{ {
$grammar = new Grammar(); $grammar = new Grammar();
self::assertEquals('Y-m-d H:i:s', $grammar->getDateFormat()); self::assertEquals('Y-m-d H:i:s', $grammar->getDateFormat());

View File

@ -17,7 +17,7 @@ use phpOMS\DataStorage\Database\Query\Grammar\MicrosoftGrammar;
class MicrosoftGrammarTest extends \PHPUnit\Framework\TestCase class MicrosoftGrammarTest extends \PHPUnit\Framework\TestCase
{ {
public function testDefault() public function testDefault() : void
{ {
self::assertInstanceOf('\phpOMS\DataStorage\Database\Query\Grammar\Grammar', new MicrosoftGrammar()); self::assertInstanceOf('\phpOMS\DataStorage\Database\Query\Grammar\Grammar', new MicrosoftGrammar());
} }

View File

@ -18,7 +18,7 @@ use phpOMS\Utils\TestUtils;
class MysqlGrammarTest extends \PHPUnit\Framework\TestCase class MysqlGrammarTest extends \PHPUnit\Framework\TestCase
{ {
public function testDefault() public function testDefault() : void
{ {
self::assertInstanceOf('\phpOMS\DataStorage\Database\Query\Grammar\Grammar', new MysqlGrammar()); self::assertInstanceOf('\phpOMS\DataStorage\Database\Query\Grammar\Grammar', new MysqlGrammar());
self::assertEquals('`', TestUtils::getMember(new MysqlGrammar(), 'systemIdentifier')); self::assertEquals('`', TestUtils::getMember(new MysqlGrammar(), 'systemIdentifier'));

View File

@ -17,7 +17,7 @@ use phpOMS\DataStorage\Database\Query\Grammar\OracleGrammar;
class OracleGrammarTest extends \PHPUnit\Framework\TestCase class OracleGrammarTest extends \PHPUnit\Framework\TestCase
{ {
public function testDefault() public function testDefault() : void
{ {
self::assertInstanceOf('\phpOMS\DataStorage\Database\Query\Grammar\Grammar', new OracleGrammar()); self::assertInstanceOf('\phpOMS\DataStorage\Database\Query\Grammar\Grammar', new OracleGrammar());
} }

View File

@ -17,7 +17,7 @@ use phpOMS\DataStorage\Database\Query\Grammar\PostgresGrammar;
class PostgresGrammarTest extends \PHPUnit\Framework\TestCase class PostgresGrammarTest extends \PHPUnit\Framework\TestCase
{ {
public function testDefault() public function testDefault() : void
{ {
self::assertInstanceOf('\phpOMS\DataStorage\Database\Query\Grammar\Grammar', new PostgresGrammar()); self::assertInstanceOf('\phpOMS\DataStorage\Database\Query\Grammar\Grammar', new PostgresGrammar());
} }

View File

@ -18,7 +18,7 @@ use phpOMS\Utils\TestUtils;
class SQLiteGrammarTest extends \PHPUnit\Framework\TestCase class SQLiteGrammarTest extends \PHPUnit\Framework\TestCase
{ {
public function testDefault() public function testDefault() : void
{ {
self::assertInstanceOf('\phpOMS\DataStorage\Database\Query\Grammar\Grammar', new SqliteGrammar()); self::assertInstanceOf('\phpOMS\DataStorage\Database\Query\Grammar\Grammar', new SqliteGrammar());
self::assertEquals('`', TestUtils::getMember(new SqliteGrammar(), 'systemIdentifier')); self::assertEquals('`', TestUtils::getMember(new SqliteGrammar(), 'systemIdentifier'));

View File

@ -16,7 +16,7 @@ namespace phpOMS\tests\DataStorage\Database\Query;
class IntoTest extends \PHPUnit\Framework\TestCase class IntoTest extends \PHPUnit\Framework\TestCase
{ {
public function testPlaceholder() public function testPlaceholder() : void
{ {
self::markTestIncomplete(); self::markTestIncomplete();
} }

View File

@ -17,7 +17,7 @@ use phpOMS\DataStorage\Database\Query\JoinType;
class JoinTypeTest extends \PHPUnit\Framework\TestCase class JoinTypeTest extends \PHPUnit\Framework\TestCase
{ {
public function testEnums() public function testEnums() : void
{ {
self::assertEquals(12, \count(JoinType::getConstants())); self::assertEquals(12, \count(JoinType::getConstants()));
self::assertEquals(JoinType::getConstants(), array_unique(JoinType::getConstants())); self::assertEquals(JoinType::getConstants(), array_unique(JoinType::getConstants()));

View File

@ -17,7 +17,7 @@ use phpOMS\DataStorage\Database\Query\QueryType;
class QueryTypeTest extends \PHPUnit\Framework\TestCase class QueryTypeTest extends \PHPUnit\Framework\TestCase
{ {
public function testEnums() public function testEnums() : void
{ {
self::assertEquals(7, \count(QueryType::getConstants())); self::assertEquals(7, \count(QueryType::getConstants()));
self::assertEquals(QueryType::getConstants(), array_unique(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