Fix phpunit 8 tests

This commit is contained in:
Dennis Eichhorn 2019-03-17 12:22:55 +01:00
parent a61a62adcc
commit ad4a2c42a5
63 changed files with 226 additions and 226 deletions

View File

@ -167,7 +167,7 @@ class AccountTest extends \PHPUnit\Framework\TestCase
public function testEmailException() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
$account = new Account();
$account->setEmail('d.duck!@#%@duckburg');
@ -175,7 +175,7 @@ class AccountTest extends \PHPUnit\Framework\TestCase
public function testStatusException() : void
{
self::expectedException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class);
self::expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class);
$account = new Account();
$account->setStatus(99);
@ -183,7 +183,7 @@ class AccountTest extends \PHPUnit\Framework\TestCase
public function testTypeException() : void
{
self::expectedException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class);
self::expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class);
$account = new Account();
$account->setType(99);

View File

@ -75,7 +75,7 @@ class GroupTest extends \PHPUnit\Framework\TestCase
public function testStatusException() : void
{
self::expectedException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class);
self::expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class);
$account = new Group();
$account->setStatus(99);

View File

@ -383,7 +383,7 @@ class FinanceFormulasTest extends \PHPUnit\Framework\TestCase
public function testInvalidNetPresentValue() : void
{
self::expectedException(\UnexpectedValueException::class);
self::expectException(\UnexpectedValueException::class);
FinanceFormulas::getNetPresentValue([], 0.1);
}

View File

@ -56,7 +56,7 @@ class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase
public function testInvalidCacheType() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
ConnectionFactory::create(['type' => 'invalid', 'path' => 'Cache']);
}

View File

@ -197,7 +197,7 @@ class FileCacheTest extends \PHPUnit\Framework\TestCase
public function testInvalidCachePath() : void
{
self::expectedException(\phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException::class);
self::expectException(\phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException::class);
$cache = new FileCache('/etc/invalidPathOrPermission^$:?><');
}

View File

@ -127,7 +127,7 @@ class MemCachedTest extends \PHPUnit\Framework\TestCase
public function testInvalidCacheHost() : void
{
self::expectedException(\phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException::class);
self::expectException(\phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException::class);
$db = $GLOBALS['CONFIG']['cache']['memcached'];
unset($db['host']);
@ -137,7 +137,7 @@ class MemCachedTest extends \PHPUnit\Framework\TestCase
public function testInvalidCachePort() : void
{
self::expectedException(\phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException::class);
self::expectException(\phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException::class);
$db = $GLOBALS['CONFIG']['cache']['memcached'];
unset($db['port']);

View File

@ -129,7 +129,7 @@ class RedisCacheTest extends \PHPUnit\Framework\TestCase
public function testInvalidCacheHost() : void
{
self::expectedException(\phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException::class);
self::expectException(\phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException::class);
$db = $GLOBALS['CONFIG']['cache']['redis'];
unset($db['host']);
@ -139,7 +139,7 @@ class RedisCacheTest extends \PHPUnit\Framework\TestCase
public function testInvalidCachePort() : void
{
self::expectedException(\phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException::class);
self::expectException(\phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException::class);
$db = $GLOBALS['CONFIG']['cache']['redis'];
unset($db['port']);
@ -149,7 +149,7 @@ class RedisCacheTest extends \PHPUnit\Framework\TestCase
public function testInvalidCacheDatabase() : void
{
self::expectedException(\phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException::class);
self::expectException(\phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException::class);
$db = $GLOBALS['CONFIG']['cache']['redis'];
unset($db['db']);

View File

@ -45,7 +45,7 @@ class CookieJarTest extends \PHPUnit\Framework\TestCase
public function testDeleteLocked() : void
{
self::expectedException(\phpOMS\DataStorage\LockException::class);
self::expectException(\phpOMS\DataStorage\LockException::class);
$jar = new CookieJar();
self::assertTrue($jar->set('test', 'value'));
@ -56,7 +56,7 @@ class CookieJarTest extends \PHPUnit\Framework\TestCase
public function testSaveLocked() : void
{
self::expectedException(\phpOMS\DataStorage\LockException::class);
self::expectException(\phpOMS\DataStorage\LockException::class);
CookieJar::lock();

View File

@ -87,7 +87,7 @@ class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase
public function testInvalidDatabaseType() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
ConnectionFactory::create(['db' => 'invalid']);
}

View File

@ -40,7 +40,7 @@ class MysqlConnectionTest extends \PHPUnit\Framework\TestCase
public function testInvalidDatabaseType() : void
{
self::expectedException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
self::expectException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
$db = $GLOBALS['CONFIG']['db']['core']['masters']['admin'];
unset($db['db']);
@ -50,7 +50,7 @@ class MysqlConnectionTest extends \PHPUnit\Framework\TestCase
public function testInvalidHost() : void
{
self::expectedException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
self::expectException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
$db = $GLOBALS['CONFIG']['db']['core']['masters']['admin'];
unset($db['host']);
@ -60,7 +60,7 @@ class MysqlConnectionTest extends \PHPUnit\Framework\TestCase
public function testInvalidPort() : void
{
self::expectedException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
self::expectException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
$db = $GLOBALS['CONFIG']['db']['core']['masters']['admin'];
unset($db['port']);
@ -70,7 +70,7 @@ class MysqlConnectionTest extends \PHPUnit\Framework\TestCase
public function testInvalidDatabase() : void
{
self::expectedException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
self::expectException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
$db = $GLOBALS['CONFIG']['db']['core']['masters']['admin'];
unset($db['database']);
@ -80,7 +80,7 @@ class MysqlConnectionTest extends \PHPUnit\Framework\TestCase
public function testInvalidLogin() : void
{
self::expectedException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
self::expectException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
$db = $GLOBALS['CONFIG']['db']['core']['masters']['admin'];
unset($db['login']);
@ -90,7 +90,7 @@ class MysqlConnectionTest extends \PHPUnit\Framework\TestCase
public function testInvalidPassword() : void
{
self::expectedException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
self::expectException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
$db = $GLOBALS['CONFIG']['db']['core']['masters']['admin'];
unset($db['password']);
@ -100,7 +100,7 @@ class MysqlConnectionTest extends \PHPUnit\Framework\TestCase
public function testInvalidDatabaseTypeName() : void
{
self::expectedException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
self::expectException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
$db = $GLOBALS['CONFIG']['db']['core']['masters']['admin'];
$db['db'] = 'invalid';
@ -110,7 +110,7 @@ class MysqlConnectionTest extends \PHPUnit\Framework\TestCase
public function testInvalidDatabaseName() : void
{
self::expectedException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
self::expectException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
$db = $GLOBALS['CONFIG']['db']['core']['masters']['admin'];
$db['database'] = 'invalid';

View File

@ -38,7 +38,7 @@ class PostgresConnectionTest extends \PHPUnit\Framework\TestCase
public function testInvalidDatabaseType() : void
{
self::expectedException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
self::expectException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
$db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin'];
unset($db['db']);
@ -47,7 +47,7 @@ class PostgresConnectionTest extends \PHPUnit\Framework\TestCase
public function testInvalidHost() : void
{
self::expectedException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
self::expectException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
$db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin'];
unset($db['host']);
@ -56,7 +56,7 @@ class PostgresConnectionTest extends \PHPUnit\Framework\TestCase
public function testInvalidPort() : void
{
self::expectedException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
self::expectException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
$db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin'];
unset($db['port']);
@ -65,7 +65,7 @@ class PostgresConnectionTest extends \PHPUnit\Framework\TestCase
public function testInvalidDatabase() : void
{
self::expectedException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
self::expectException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
$db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin'];
unset($db['database']);
@ -74,7 +74,7 @@ class PostgresConnectionTest extends \PHPUnit\Framework\TestCase
public function testInvalidLogin() : void
{
self::expectedException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
self::expectException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
$db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin'];
unset($db['login']);
@ -83,7 +83,7 @@ class PostgresConnectionTest extends \PHPUnit\Framework\TestCase
public function testInvalidPassword() : void
{
self::expectedException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
self::expectException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
$db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin'];
unset($db['password']);
@ -92,7 +92,7 @@ class PostgresConnectionTest extends \PHPUnit\Framework\TestCase
public function testInvalidDatabaseTypeName() : void
{
self::expectedException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
self::expectException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
$db = $GLOBALS['CONFIG']['db']['core']['postgresql']['admin'];
$db['db'] = 'invalid';

View File

@ -36,7 +36,7 @@ class SQLiteConnectionTest extends \PHPUnit\Framework\TestCase
public function testInvalidDatabaseType() : void
{
self::expectedException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
self::expectException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
$db = $GLOBALS['CONFIG']['db']['core']['sqlite']['admin'];
unset($db['db']);
@ -45,7 +45,7 @@ class SQLiteConnectionTest extends \PHPUnit\Framework\TestCase
public function testInvalidDatabase() : void
{
self::expectedException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
self::expectException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
$db = $GLOBALS['CONFIG']['db']['core']['sqlite']['admin'];
unset($db['database']);

View File

@ -39,7 +39,7 @@ class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase
public function testInvalidDatabaseType() : void
{
self::expectedException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
self::expectException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
$db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin'];
unset($db['db']);
@ -48,7 +48,7 @@ class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase
public function testInvalidHost() : void
{
self::expectedException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
self::expectException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
$db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin'];
unset($db['host']);
@ -57,7 +57,7 @@ class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase
public function testInvalidPort() : void
{
self::expectedException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
self::expectException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
$db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin'];
unset($db['port']);
@ -66,7 +66,7 @@ class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase
public function testInvalidDatabase() : void
{
self::expectedException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
self::expectException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
$db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin'];
unset($db['database']);
@ -75,7 +75,7 @@ class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase
public function testInvalidLogin() : void
{
self::expectedException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
self::expectException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
$db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin'];
unset($db['login']);
@ -84,7 +84,7 @@ class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase
public function testInvalidPassword() : void
{
self::expectedException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
self::expectException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
$db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin'];
unset($db['password']);
@ -93,7 +93,7 @@ class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase
public function testInvalidDatabaseTypeName() : void
{
self::expectedException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
self::expectException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
$db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin'];
$db['db'] = 'invalid';
@ -102,7 +102,7 @@ class SqlServerConnectionTest extends \PHPUnit\Framework\TestCase
public function testInvalidDatabaseName() : void
{
self::expectedException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
self::expectException(\phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException::class);
$db = $GLOBALS['CONFIG']['db']['core']['mssql']['admin'];
$db['database'] = 'invalid';

View File

@ -306,7 +306,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
public function testReadOnlyRaw() : void
{
self::expectedException(\Exception::class);
self::expectException(\Exception::class);
$query = new Builder($this->con, true);
$query->raw('DROP DATABASE oms;');
@ -314,7 +314,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
public function testReadOnlyInsert() : void
{
self::expectedException(\Exception::class);
self::expectException(\Exception::class);
$query = new Builder($this->con, true);
$query->insert('test');
@ -322,7 +322,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
public function testReadOnlyUpdate() : void
{
self::expectedException(\Exception::class);
self::expectException(\Exception::class);
$query = new Builder($this->con, true);
$query->update();
@ -330,7 +330,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
public function testReadOnlyDelete() : void
{
self::expectedException(\Exception::class);
self::expectException(\Exception::class);
$query = new Builder($this->con, true);
$query->delete();
@ -338,7 +338,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
public function testInvalidWhereOperator() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
$query = new Builder($this->con, true);
$query->where('a', 'invalid', 'b');
@ -346,7 +346,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
public function testInvalidJoinTable() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
$query = new Builder($this->con, true);
$query->join(null);
@ -354,7 +354,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
public function testInvalidJoinOperator() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
$query = new Builder($this->con, true);
$query->join('b')->on('a', 'invalid', 'b');
@ -362,7 +362,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
public function testInvalidOrOrderType() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
$query = new Builder($this->con, true);
$query->orderBy('a', 1);
@ -370,7 +370,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase
public function testInvalidOrColumnType() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
$query = new Builder($this->con, true);
$query->orderBy(null, 'DESC');

View File

@ -81,7 +81,7 @@ class JsonBuilderTest extends \PHPUnit\Framework\TestCase
public function testReadOnlyInsert() : void
{
self::expectedException(\Exception::class);
self::expectException(\Exception::class);
$query = new JsonBuilder(true);
$query->insert('test');
@ -89,7 +89,7 @@ class JsonBuilderTest extends \PHPUnit\Framework\TestCase
public function testReadOnlyUpdate() : void
{
self::expectedException(\Exception::class);
self::expectException(\Exception::class);
$query = new JsonBuilder(true);
$query->update();
@ -97,7 +97,7 @@ class JsonBuilderTest extends \PHPUnit\Framework\TestCase
public function testReadOnlyDelete() : void
{
self::expectedException(\Exception::class);
self::expectException(\Exception::class);
$query = new JsonBuilder(true);
$query->delete();
@ -105,7 +105,7 @@ class JsonBuilderTest extends \PHPUnit\Framework\TestCase
public function testInvalidWhereOperator() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
$query = new JsonBuilder(true);
$query->where('a', 'invalid', 'b');
@ -113,7 +113,7 @@ class JsonBuilderTest extends \PHPUnit\Framework\TestCase
public function testInvalidJoinTable() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
$query = new JsonBuilder(true);
$query->join(null);
@ -121,7 +121,7 @@ class JsonBuilderTest extends \PHPUnit\Framework\TestCase
public function testInvalidJoinOperator() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
$query = new JsonBuilder(true);
$query->join('b')->on('a', 'invalid', 'b');
@ -129,7 +129,7 @@ class JsonBuilderTest extends \PHPUnit\Framework\TestCase
public function testInvalidOrOrderType() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
$query = new JsonBuilder(true);
$query->orderBy('a', 1);
@ -137,7 +137,7 @@ class JsonBuilderTest extends \PHPUnit\Framework\TestCase
public function testInvalidOrColumnType() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
$query = new JsonBuilder(true);
$query->orderBy(null, 'DESC');

View File

@ -120,28 +120,28 @@ class DispatcherTest extends \PHPUnit\Framework\TestCase
public function testInvalidDestination() : void
{
self::expectedException(\UnexpectedValueException::class);
self::expectException(\UnexpectedValueException::class);
$this->app->dispatcher->dispatch(true);
}
public function testInvalidControllerPath() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
$this->app->dispatcher->dispatch('phpOMS\tests\Dispatcher\TestControllers::testFunctionStatic');
}
public function testInvalidControllerFunction() : void
{
self::expectedException(\Exception::class);
self::expectException(\Exception::class);
$this->app->dispatcher->dispatch('phpOMS\tests\Dispatcher\TestController::testFunctionStaticINVALID');
}
public function testInvalidControllerString() : void
{
self::expectedException(\UnexpectedValueException::class);
self::expectException(\UnexpectedValueException::class);
$this->app->dispatcher->dispatch('phpOMS\tests\Dispatcher\TestController::testFunctionStatic:failure');
}

View File

@ -39,7 +39,7 @@ class CurrencyMapperTest extends \PHPUnit\Framework\TestCase
self::assertEquals('EUR', $obj->getCode());
self::assertEquals(978, $obj->getNumber());
self::assertEquals(2, $obj->getDecimals());
self::assertContains('Germany', $obj->getCountries());
self::assertStringContainsString('Germany', $obj->getCountries());
}
public static function tearDownAfterClass() : void

View File

@ -37,7 +37,7 @@ class L11nManagerTest extends \PHPUnit\Framework\TestCase
public function testInvalidModule() : void
{
self::expectedException(\Exception::class);
self::expectException(\Exception::class);
$expected = [
'en' => [

View File

@ -66,7 +66,7 @@ class LocalizationTest extends \PHPUnit\Framework\TestCase
public function testInvalidLanguage() : void
{
self::expectedException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class);
self::expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class);
$localization = new Localization();
$localization->setLanguage('abc');
@ -74,7 +74,7 @@ class LocalizationTest extends \PHPUnit\Framework\TestCase
public function testInvalidCountry() : void
{
self::expectedException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class);
self::expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class);
$localization = new Localization();
$localization->setCountry('abc');
@ -82,7 +82,7 @@ class LocalizationTest extends \PHPUnit\Framework\TestCase
public function testInvalidTimezone() : void
{
self::expectedException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class);
self::expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class);
$localization = new Localization();
$localization->setTimezone('abc');
@ -90,7 +90,7 @@ class LocalizationTest extends \PHPUnit\Framework\TestCase
public function testInvalidCurrency() : void
{
self::expectedException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class);
self::expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class);
$localization = new Localization();
$localization->setCurrency('abc');
@ -151,7 +151,7 @@ class LocalizationTest extends \PHPUnit\Framework\TestCase
public function testInvalidLocalizationLoading() : void
{
self::expectedException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class);
self::expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class);
$localization = new Localization();
$localization->loadFromLanguage('INVALID');

View File

@ -149,7 +149,7 @@ class FileLoggerTest extends \PHPUnit\Framework\TestCase
public function testLogException() : void
{
self::expectedException(phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class);
self::expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class);
$log = new FileLogger(__DIR__ . '/test.log');
$log->log('testException', FileLogger::MSG_FULL, [

View File

@ -30,12 +30,12 @@ class CholeskyDecompositionTest extends \PHPUnit\Framework\TestCase
$cholesky = new CholeskyDecomposition($A);
self::assertEquals(
self::assertEqualsWithDelta(
$A->toArray(),
$cholesky->getL()
->mult($cholesky->getL()->transpose())
->toArray(),
'', 0.2
0.2
);
}
@ -50,11 +50,11 @@ class CholeskyDecompositionTest extends \PHPUnit\Framework\TestCase
$cholesky = new CholeskyDecomposition($A);
self::assertEquals([
self::assertEqualsWithDelta([
[5, 0, 0],
[3, 3, 0],
[-1, 1, 3],
], $cholesky->getL()->toArray(), '', 0.2);
], $cholesky->getL()->toArray(), 0.2);
self::assertTrue($cholesky->isSpd());
}
@ -77,7 +77,7 @@ class CholeskyDecompositionTest extends \PHPUnit\Framework\TestCase
public function testInvalidDimension() : void
{
self::expectedException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class);
self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class);
$A = new Matrix();
$A->setMatrix([

View File

@ -32,17 +32,17 @@ class EigenvalueDecompositionTest extends \PHPUnit\Framework\TestCase
self::assertTrue($eig->isSymmetric());
self::assertEqualsWithDelta([0, 2, 5], $eig->getRealEigenvalues()->toArray(), 0.2);
self::assertEquals([
self::assertEqualsWithDelta([
[0, 2/sqrt(6), 1/sqrt(3)],
[1/sqrt(2), -1/sqrt(6), 1/sqrt(3)],
[-1/sqrt(2), -1/sqrt(6), 1/sqrt(3)],
], $eig->getV()->toArray(), '', 0.2);
], $eig->getV()->toArray(), 0.2);
self::assertEquals([
self::assertEqualsWithDelta([
[0, 0, 0],
[0, 2, 0],
[0, 0, 5],
], $eig->getD()->toArray(), '', 0.2);
], $eig->getD()->toArray(), 0.2);
}
public function testNonSymmetricMatrix() : void
@ -59,17 +59,17 @@ class EigenvalueDecompositionTest extends \PHPUnit\Framework\TestCase
self::assertFalse($eig->isSymmetric());
self::assertEqualsWithDelta([-5, 3, 6], $eig->getRealEigenvalues()->toArray(), 0.2);
self::assertEquals([
self::assertEqualsWithDelta([
[-sqrt(2/3), sqrt(2/7), -1/sqrt(293)],
[-1/sqrt(6), -3/sqrt(14), -6/sqrt(293)],
[1/sqrt(6), -1/sqrt(14), -16/sqrt(293)],
], $eig->getV()->toArray(), '', 0.2);
], $eig->getV()->toArray(), 0.2);
self::assertEquals([
self::assertEqualsWithDelta([
[-5, 0, 0],
[0, 3, 0],
[0, 0, 6],
], $eig->getD()->toArray(), '', 0.2);
], $eig->getD()->toArray(), 0.2);
}
public function testCompositeSymmetric() : void
@ -83,13 +83,13 @@ class EigenvalueDecompositionTest extends \PHPUnit\Framework\TestCase
$eig = new EigenvalueDecomposition($A);
self::assertEquals(
self::assertEqualsWithDelta(
$A->toArray(),
$eig->getV()
->mult($eig->getD())
->mult($eig->getV()->transpose())
->toArray()
, '', 0.2);
, 0.2);
}
public function testCompositeNonSymmetric() : void
@ -103,13 +103,13 @@ class EigenvalueDecompositionTest extends \PHPUnit\Framework\TestCase
$eig = new EigenvalueDecomposition($A);
self::assertEquals(
self::assertEqualsWithDelta(
$A->toArray(),
$eig->getV()
->mult($eig->getD())
->mult($eig->getV()->inverse())
->toArray(),
'', 0.2
0.2
);
}
}

View File

@ -30,17 +30,17 @@ class LUDecompositionTest extends \PHPUnit\Framework\TestCase
$lu = new LUDecomposition($B);
self::assertEquals([
self::assertEqualsWithDelta([
[1, 0, 0],
[0.6, 1, 0],
[-0.2, 0.375, 1],
], $lu->getL()->toArray(), '', 0.2);
], $lu->getL()->toArray(), 0.2);
self::assertEquals([
self::assertEqualsWithDelta([
[25, 15, -5],
[0, 8, 3],
[0, 0, 8.875],
], $lu->getU()->toArray(), '', 0.2);
], $lu->getU()->toArray(), 0.2);
$vec = new Vector();
$vec->setMatrix([[40], [49], [28]]);
@ -65,7 +65,7 @@ class LUDecompositionTest extends \PHPUnit\Framework\TestCase
public function testSolveOfSingularMatrix() : void
{
self::expectedException(\Exception::class);
self::expectException(\Exception::class);
$B = new Matrix();
$B->setMatrix([
@ -93,18 +93,18 @@ class LUDecompositionTest extends \PHPUnit\Framework\TestCase
$lu = new LUDecomposition($A);
self::assertEquals(
self::assertEqualsWithDelta(
$A->toArray(),
$lu->getL()
->mult($lu->getU())
->toArray(),
'', 0.2
0.2
);
}
public function testInvalidDimension() : void
{
self::expectedException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class);
self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class);
$B = new Matrix();
$B->setMatrix([

View File

@ -271,7 +271,7 @@ class MatrixTest extends \PHPUnit\Framework\TestCase
public function testInvalidSetIndexException() : void
{
self::expectedException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class);
self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class);
$id = new Matrix();
$id->setMatrix([
@ -283,7 +283,7 @@ class MatrixTest extends \PHPUnit\Framework\TestCase
public function testInvalidGetIndexException() : void
{
self::expectedException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class);
self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class);
$id = new Matrix();
$id->setMatrix([
@ -295,7 +295,7 @@ class MatrixTest extends \PHPUnit\Framework\TestCase
public function testInvalidSub() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
$id = new Matrix();
$id->setMatrix([
@ -308,7 +308,7 @@ class MatrixTest extends \PHPUnit\Framework\TestCase
public function testInvalidAdd() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
$id = new Matrix();
$id->setMatrix([
@ -321,7 +321,7 @@ class MatrixTest extends \PHPUnit\Framework\TestCase
public function testInvalidMult() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
$id = new Matrix();
$id->setMatrix([
@ -334,7 +334,7 @@ class MatrixTest extends \PHPUnit\Framework\TestCase
public function testInvalidDimensionAdd() : void
{
self::expectedException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class);
self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class);
$A = new Matrix();
$A->setMatrix([[1, 2], [3, 4]]);
@ -347,7 +347,7 @@ class MatrixTest extends \PHPUnit\Framework\TestCase
public function testInvalidDimensionSub() : void
{
self::expectedException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class);
self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class);
$A = new Matrix();
$A->setMatrix([[1, 2], [3, 4]]);

View File

@ -32,17 +32,17 @@ class QRDecompositionTest extends \PHPUnit\Framework\TestCase
self::assertTrue($QR->isFullRank());
self::assertEquals([
self::assertEqualsWithDelta([
[-6 / 7, 69 / 175, -58 / 175],
[-3 / 7, -158 / 175, -6 / 175],
[2 / 7, -6 / 35, -33 / 35],
], $QR->getQ()->toArray(), '', 0.2);
], $QR->getQ()->toArray(), 0.2);
self::assertEquals([
self::assertEqualsWithDelta([
[-14, -21, 14],
[0, -175, 70],
[0, 0, 35],
], $QR->getR()->toArray(), '', 0.2);
], $QR->getR()->toArray(), 0.2);
}
public function testComposition() : void
@ -56,12 +56,12 @@ class QRDecompositionTest extends \PHPUnit\Framework\TestCase
$QR = new QRDecomposition($A);
self::assertEquals(
self::assertEqualsWithDelta(
$A->toArray(),
$QR->getQ()
->mult($QR->getR())
->toArray(),
'', 0.2
0.2
);
}

View File

@ -109,7 +109,7 @@ class ComplexTest extends \PHPUnit\Framework\TestCase
public function testInvalidAdd() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
$cpl = new Complex(4, 3);
$cpl->add(true);
@ -117,7 +117,7 @@ class ComplexTest extends \PHPUnit\Framework\TestCase
public function testInvalidSub() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
$cpl = new Complex(4, 3);
$cpl->sub(true);
@ -125,7 +125,7 @@ class ComplexTest extends \PHPUnit\Framework\TestCase
public function testInvalidMult() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
$cpl = new Complex(4, 3);
$cpl->mult(true);
@ -133,7 +133,7 @@ class ComplexTest extends \PHPUnit\Framework\TestCase
public function testInvalidDiv() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
$cpl = new Complex(4, 3);
$cpl->div(true);
@ -141,7 +141,7 @@ class ComplexTest extends \PHPUnit\Framework\TestCase
public function testInvalidPow() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
$cpl = new Complex(4, 3);
$cpl->pow(true);

View File

@ -40,7 +40,7 @@ class IntegerTest extends \PHPUnit\Framework\TestCase
public function testInvalidFermatParameter() : void
{
self::expectedException(\Exception::class);
self::expectException(\Exception::class);
Integer::fermatFactor(8);
}

View File

@ -38,10 +38,10 @@ class AverageTest extends \PHPUnit\Framework\TestCase
public function testWeightedAverage() : void
{
self::assertEquals(69 / 20, Average::weightedAverage(
self::assertEqualsWithDelta(69 / 20, Average::weightedAverage(
[1, 2, 3, 4, 5, 6, 7],
[0.1, 0.2, 0.3, 0.1, 0.2, 0.05, 0.05]
), '', 0.01);
), 0.01);
}
public function testGeometricMean() : void
@ -68,28 +68,28 @@ class AverageTest extends \PHPUnit\Framework\TestCase
public function testInvalidWeightedAverageDimension() : void
{
self::expectedException(phpOMS\Math\Matrix\Exception\InvalidDimensionException::class);
self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class);
Average::weightedAverage([1, 2, 3, 4, 5, 6, 7], [0.1, 0.2, 0.3, 0.1, 0.2, 0.05]);
}
public function testInvalidArithmeticMeanZeroDevision() : void
{
self::expectedException(phpOMS\Math\Exception\ZeroDevisionException::class);
self::expectException(\phpOMS\Math\Exception\ZeroDevisionException::class);
Average::arithmeticMean([]);
}
public function testInvalidGeometricMean() : void
{
self::expectedException(phpOMS\Math\Exception\ZeroDevisionException::class);
self::expectException(\phpOMS\Math\Exception\ZeroDevisionException::class);
Average::geometricMean([]);
}
public function testInvalidHarmonicMean() : void
{
self::expectedException(phpOMS\Math\Exception\ZeroDevisionException::class);
self::expectException(\phpOMS\Math\Exception\ZeroDevisionException::class);
Average::harmonicMean([1, 2, 3, 0, 5, 6, 7]);
}

View File

@ -19,12 +19,12 @@ class CorrelationTest extends \PHPUnit\Framework\TestCase
{
public function testBravisPersonCorrelationCoefficient() : void
{
self::assertEquals(
self::assertEqualsWithDelta(
0.8854,
Correlation::bravaisPersonCorrelationCoefficient(
[1, 2, 3, 4, 5, 6, 7],
[3, 4, 5, 9, 7, 8, 9]
), '', 0.01
), 0.01
);
}

View File

@ -45,7 +45,7 @@ class LevelLevelRegressionTest extends \PHPUnit\Framework\TestCase
public function testInvalidDimension() : void
{
self::expectedException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class);
self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class);
$x = [1,2, 3];
$y = [1,2, 3, 4];

View File

@ -47,7 +47,7 @@ class LevelLogRegressionTest extends \PHPUnit\Framework\TestCase
public function testInvalidDimension() : void
{
self::expectedException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class);
self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class);
$x = [1,2, 3];
$y = [1,2, 3, 4];

View File

@ -47,7 +47,7 @@ class LogLevelRegressionTest extends \PHPUnit\Framework\TestCase
public function testInvalidDimension() : void
{
self::expectedException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class);
self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class);
$x = [1,2, 3];
$y = [1,2, 3, 4];

View File

@ -47,7 +47,7 @@ class LogLogRegressionTest extends \PHPUnit\Framework\TestCase
public function testInvalidDimension() : void
{
self::expectedException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class);
self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class);
$x = [1,2, 3];
$y = [1,2, 3, 4];

View File

@ -29,12 +29,12 @@ class MeasureOfDispersionTest extends \PHPUnit\Framework\TestCase
public function testEmpiricalCovariance() : void
{
self::assertEquals(
self::assertEqualsWithDelta(
4.667,
MeasureOfDispersion::empiricalCovariance(
[1, 2, 3, 4, 5, 6, 7],
[3, 4, 5, 9, 7, 8, 9]
), '', 0.01
), 0.01
);
}
@ -64,35 +64,35 @@ class MeasureOfDispersionTest extends \PHPUnit\Framework\TestCase
public function testInvalidEmpiricalVariationCoefficient() : void
{
self::expectedException(phpOMS\Math\Exception\ZeroDevisionException::class);
self::expectException(\phpOMS\Math\Exception\ZeroDevisionException::class);
MeasureOfDispersion::empiricalVariationCoefficient([1, 2, 3, 4, 5, 6, 7], 0);
}
public function testInvalidEmpiricalCovariance() : void
{
self::expectedException(phpOMS\Math\Exception\ZeroDevisionException::class);
self::expectException(\phpOMS\Math\Exception\ZeroDevisionException::class);
MeasureOfDispersion::empiricalCovariance([], []);
}
public function testInvalidEmpiricalCovarianceDimension() : void
{
self::expectedException(phpOMS\Math\Matrix\Exception\InvalidDimensionException::class);
self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class);
MeasureOfDispersion::empiricalCovariance([1, 2, 3, 4], [1, 2, 3]);
}
public function testInvalidSampleVariance() : void
{
self::expectedException(phpOMS\Math\Exception\ZeroDevisionException::class);
self::expectException(\phpOMS\Math\Exception\ZeroDevisionException::class);
MeasureOfDispersion::sampleVariance([]);
}
public function testInvalidEmpiricalVariance() : void
{
self::expectedException(phpOMS\Math\Exception\ZeroDevisionException::class);
self::expectException(\phpOMS\Math\Exception\ZeroDevisionException::class);
MeasureOfDispersion::empiricalVariance([]);
}

View File

@ -94,28 +94,28 @@ class ChiSquaredDistributionTest extends \PHPUnit\Framework\TestCase
public function testHypothesisSizeException() : void
{
self::expectedException(\Exception::class);
self::expectException(\Exception::class);
ChiSquaredDistribution::testHypothesis([1, 2], [2]);
}
public function testHypothesisDegreesOfFreedomException() : void
{
self::expectedException(\Exception::class);
self::expectException(\Exception::class);
ChiSquaredDistribution::testHypothesis([], []);
}
public function testPdfOutOfBoundsException() : void
{
self::expectedException(\OutOfBoundsException::class);
self::expectException(\OutOfBoundsException::class);
ChiSquaredDistribution::getPdf(-1, 0);
}
public function testMgfOutOfBoundsException() : void
{
self::expectedException(\OutOfBoundsException::class);
self::expectException(\OutOfBoundsException::class);
ChiSquaredDistribution::getMgf(1, 0.6);
}

View File

@ -73,7 +73,7 @@ class ExponentialDistributionTest extends \PHPUnit\Framework\TestCase
public function testMgfException() : void
{
self::expectedException(\OutOfBoundsException::class);
self::expectException(\OutOfBoundsException::class);
ExponentialDistribution::getMgf(3, 3);
}

View File

@ -78,7 +78,7 @@ class LaplaceDistributionTest extends \PHPUnit\Framework\TestCase
public function testMgfException() : void
{
self::expectedException(\OutOfBoundsException::class);
self::expectException(\OutOfBoundsException::class);
LaplaceDistribution::getMgf(3, 2, 4);
}

View File

@ -74,14 +74,14 @@ class UniformDistributionDiscreteTest extends \PHPUnit\Framework\TestCase
public function testCdfExceptionUpper() : void
{
self::expectedException(\OutOfBoundsException::class);
self::expectException(\OutOfBoundsException::class);
UniformDistributionDiscrete::getCdf(5, 2, 4);
}
public function testCdfExceptionLower() : void
{
self::expectedException(\OutOfBoundsException::class);
self::expectException(\OutOfBoundsException::class);
UniformDistributionDiscrete::getCdf(1, 2, 4);
}

View File

@ -95,7 +95,7 @@ class RequestTest extends \PHPUnit\Framework\TestCase
public function testInvalidRouteVerb() : void
{
self::expectedException(\Exception::class);
self::expectException(\Exception::class);
$request = new Request(new Argument('get:some/test/path'));
$request->setMethod('failure');

View File

@ -110,7 +110,7 @@ class RequestTest extends \PHPUnit\Framework\TestCase
public function testRestRequest() : void
{
$request = new Request(new Http('http://orange-management.de/phpOMS/LICENSE.txt'));
$request = new Request(new Http('https://raw.githubusercontent.com/Orange-Management/Orange-Management/develop/LICENSE.txt'));
$request->setMethod(RequestMethod::GET);
self::assertEquals(
@ -121,7 +121,7 @@ class RequestTest extends \PHPUnit\Framework\TestCase
public function testInvalidHttpsPort() : void
{
self::expectedException(\OutOfRangeException::class);
self::expectException(\OutOfRangeException::class);
$request = new Request(new Http('http://www.google.com/test/path'));
$request->isHttps(-1);
@ -129,7 +129,7 @@ class RequestTest extends \PHPUnit\Framework\TestCase
public function testInvalidRouteVerb() : void
{
self::expectedException(\Exception::class);
self::expectException(\Exception::class);
$request = new Request(new Http('http://www.google.com/test/path'));
$request->setMethod('failure');

View File

@ -22,7 +22,7 @@ class RestTest extends \PHPUnit\Framework\TestCase
{
public function testRequest() : void
{
$request = new Request(new Http('http://orange-management.de/phpOMS/LICENSE.txt'));
$request = new Request(new Http('https://raw.githubusercontent.com/Orange-Management/Orange-Management/develop/LICENSE.txt'));
$request->setMethod(RequestMethod::GET);
self::assertEquals(

View File

@ -52,7 +52,7 @@ class InfoManagerTest extends \PHPUnit\Framework\TestCase
public function testInvalidPathLoad() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
$info = new InfoManager(__DIR__ . '/invalid.json');
$info->load();
@ -60,7 +60,7 @@ class InfoManagerTest extends \PHPUnit\Framework\TestCase
public function testInvalidPathUpdate() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
$info = new InfoManager(__DIR__ . '/invalid.json');
$info->update();
@ -68,7 +68,7 @@ class InfoManagerTest extends \PHPUnit\Framework\TestCase
public function testInvalidDataSet() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
$info = new InfoManager(__DIR__ . '/info-test.json');
$info->load();

View File

@ -33,7 +33,7 @@ class EnumArrayTest extends \PHPUnit\Framework\TestCase
public function testInvalidConstantException() : void
{
self::expectedException(\OutOfBoundsException::class);
self::expectException(\OutOfBoundsException::class);
EnumArrayDemo::get('enum2');
}

View File

@ -36,7 +36,7 @@ class EnumTest extends \PHPUnit\Framework\TestCase
public function testEmailException() : void
{
self::expectedException(\Exception::class);
self::expectException(\Exception::class);
EnumDemo::getByName('ENUM3');
}

View File

@ -51,21 +51,21 @@ class IbanTest extends \PHPUnit\Framework\TestCase
public function testInvalidIbanCountry() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
$iban = new Iban('ZZ22 6008 0000 0960 0280 00');
}
public function testInvalidIbanLength() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
$iban = new Iban('DE22 6008 0000 0960 0280 0');
}
public function testInvalidIbanChecksum() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
$iban = new Iban('DEA9 6008 0000 0960 0280 00');
}

View File

@ -213,7 +213,7 @@ class PriorityQueueTest extends \PHPUnit\Framework\TestCase
public function testInvalidPriority() : void
{
self::expectedException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class);
self::expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class);
$queue = new PriorityQueue(99999);
}

View File

@ -102,7 +102,7 @@ class DirectoryTest extends \PHPUnit\Framework\TestCase
public function testInvalidCreatedPath() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
self::assertNotFalse($this->con);
@ -111,7 +111,7 @@ class DirectoryTest extends \PHPUnit\Framework\TestCase
public function testInvalidChangedPath() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
self::assertNotFalse($this->con);
@ -120,7 +120,7 @@ class DirectoryTest extends \PHPUnit\Framework\TestCase
public function testInvalidSizePath() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
self::assertNotFalse($this->con);
@ -129,7 +129,7 @@ class DirectoryTest extends \PHPUnit\Framework\TestCase
public function testInvalidPermissionPath() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
self::assertNotFalse($this->con);
@ -138,7 +138,7 @@ class DirectoryTest extends \PHPUnit\Framework\TestCase
public function testInvalidOwnerPath() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
self::assertNotFalse($this->con);

View File

@ -96,7 +96,7 @@ class FileTest extends \PHPUnit\Framework\TestCase
public function testInvalidGetPath() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
self::assertNotFalse($this->con);
@ -117,7 +117,7 @@ class FileTest extends \PHPUnit\Framework\TestCase
public function testInvalidCreatedPath() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
self::assertNotFalse($this->con);
@ -126,7 +126,7 @@ class FileTest extends \PHPUnit\Framework\TestCase
public function testInvalidChangedPath() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
self::assertNotFalse($this->con);
@ -135,7 +135,7 @@ class FileTest extends \PHPUnit\Framework\TestCase
public function testInvalidSizePath() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
self::assertNotFalse($this->con);
@ -144,7 +144,7 @@ class FileTest extends \PHPUnit\Framework\TestCase
public function testInvalidPermissionPath() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
self::assertNotFalse($this->con);
@ -153,7 +153,7 @@ class FileTest extends \PHPUnit\Framework\TestCase
public function testInvalidOwnerPath() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
self::assertNotFalse($this->con);

View File

@ -83,35 +83,35 @@ class DirectoryTest extends \PHPUnit\Framework\TestCase
public function testInvalidCreatedPath() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
Directory::created(__DIR__ . '/invalid');
}
public function testInvalidChangedPath() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
Directory::changed(__DIR__ . '/invalid');
}
public function testInvalidSizePath() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
Directory::size(__DIR__ . '/invalid');
}
public function testInvalidPermissionPath() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
Directory::permission(__DIR__ . '/invalid');
}
public function testInvalidOwnerPath() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
Directory::owner(__DIR__ . '/invalid');
}

View File

@ -81,7 +81,7 @@ class FileTest extends \PHPUnit\Framework\TestCase
public function testInvalidGetPath() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
File::get(__DIR__ . '/invalid.txt');
}
@ -98,35 +98,35 @@ class FileTest extends \PHPUnit\Framework\TestCase
public function testInvalidCreatedPath() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
File::created(__DIR__ . '/invalid.txt');
}
public function testInvalidChangedPath() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
File::changed(__DIR__ . '/invalid.txt');
}
public function testInvalidSizePath() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
File::size(__DIR__ . '/invalid.txt');
}
public function testInvalidPermissionPath() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
File::permission(__DIR__ . '/invalid.txt');
}
public function testInvalidOwnerPath() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
File::owner(__DIR__ . '/invalid.txt');
}

View File

@ -127,49 +127,49 @@ class LocalStorageTest extends \PHPUnit\Framework\TestCase
public function testInvalidPutPath() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
LocalStorage::put(__DIR__, 'Test');
}
public function testInvalidGetPath() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
LocalStorage::get(__DIR__);
}
public function testInvalidListPath() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
LocalStorage::list(__DIR__ . '/LocalStorageTest.php');
}
public function testInvalidSetPath() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
LocalStorage::set(__DIR__, 'Test');
}
public function testInvalidAppendPath() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
LocalStorage::append(__DIR__, 'Test');
}
public function testInvalidPrependPath() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
LocalStorage::prepend(__DIR__, 'Test');
}
public function testInvalidExtensionPath() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
LocalStorage::extension(__DIR__);
}

View File

@ -20,7 +20,7 @@ class PathExceptionTest extends \PHPUnit\Framework\TestCase
public function testConstructor() : void
{
$e = new PathException('test.file');
self::assertContains('test.file', $e->getMessage());
self::assertStringContainsString('test.file', $e->getMessage());
self::assertEquals(0, $e->getCode());
$this->isInstanceOf('\UnexpectedValueException');
}

View File

@ -20,7 +20,7 @@ class PermissionExceptionTest extends \PHPUnit\Framework\TestCase
public function testConstructor() : void
{
$e = new PermissionException('test.file');
self::assertContains('test.file', $e->getMessage());
self::assertStringContainsString('test.file', $e->getMessage());
self::assertEquals(0, $e->getCode());
$this->isInstanceOf('\RuntimeException');
}

View File

@ -31,7 +31,7 @@ class StorageTest extends \PHPUnit\Framework\TestCase
public function testInvalidStorage() : void
{
self::expectedException(\Exception::class);
self::expectException(\Exception::class);
self::assertInstanceOf('\phpOMS\System\File\Local\LocalStorage', Storage::env('invalid'));
}

View File

@ -32,21 +32,21 @@ class C128AbstractTest extends \PHPUnit\Framework\TestCase
public function testInvalidDimensionWidth() : void
{
self::expectedException(\OutOfBoundsException::class);
self::expectException(\OutOfBoundsException::class);
$this->obj->setDimension(-2, 1);
}
public function testInvalidDimensionHeight() : void
{
self::expectedException(\OutOfBoundsException::class);
self::expectException(\OutOfBoundsException::class);
$this->obj->setDimension(1, -2);
}
public function testInvalidOrientation() : void
{
self::expectedException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class);
self::expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class);
$this->obj->setOrientation(99);
}

View File

@ -75,7 +75,7 @@ class C25Test extends \PHPUnit\Framework\TestCase
public function testInvalidOrientation() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
$img = new C25('45f!a?12');
}

View File

@ -29,21 +29,21 @@ class CurrencyTest extends \PHPUnit\Framework\TestCase
public function testInvalidFromEur() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
Currency::fromEurTo(1, 'ERROR');
}
public function testInvalidToEur() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
Currency::fromToEur(1, 'ERROR');
}
public function testInvalidConvert() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
Currency::convertCurrency(1, 'ERROR', 'TEST');
}

View File

@ -162,154 +162,154 @@ class MeasurementTest extends \PHPUnit\Framework\TestCase
public function testInvalidTemperatureFrom() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
Measurement::convertTemperature(1.1, 'invalid', TemperatureType::CELSIUS);
}
public function testInvalidTemperatureTo() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
Measurement::convertTemperature(1.1, TemperatureType::CELSIUS, 'invalid');
}
public function testInvalidWeightFrom() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
Measurement::convertWeight(1.1, 'invalid', WeightType::KILOGRAM);
}
public function testInvalidWeightTo() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
Measurement::convertWeight(1.1, WeightType::KILOGRAM, 'invalid');
}
public function testInvalidLengthFrom() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
Measurement::convertLength(1.1, 'invalid', LengthType::METERS);
}
public function testInvalidLengthTo() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
Measurement::convertLength(1.1, LengthType::METERS, 'invalid');
}
public function testInvalidAreaFrom() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
Measurement::convertArea(1.1, 'invalid', AreaType::SQUARE_METERS);
}
public function testInvalidAreaTo() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
Measurement::convertArea(1.1, AreaType::SQUARE_METERS, 'invalid');
}
public function testInvalidVolumeFrom() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
Measurement::convertVolume(1.1, 'invalid', VolumeType::LITER);
}
public function testInvalidVolumeTo() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
Measurement::convertVolume(1.1, VolumeType::LITER, 'invalid');
}
public function testInvalidSpeedFrom() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
Measurement::convertSpeed(1.1, 'invalid', SpeedType::KILOMETERS_PER_HOUR);
}
public function testInvalidSpeedTo() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
Measurement::convertSpeed(1.1, SpeedType::KILOMETERS_PER_HOUR, 'invalid');
}
public function testInvalidTimeFrom() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
Measurement::convertTime(1.1, 'invalid', TimeType::HOURS);
}
public function testInvalidTimeTo() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
Measurement::convertTime(1.1, TimeType::HOURS, 'invalid');
}
public function testInvalidAngleFrom() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
Measurement::convertAngle(1.1, 'invalid', AngleType::RADIAN);
}
public function testInvalidAngleTo() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
Measurement::convertAngle(1.1, AngleType::RADIAN, 'invalid');
}
public function testInvalidPressureFrom() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
Measurement::convertPressure(1.1, 'invalid', PressureType::BAR);
}
public function testInvalidPressureTo() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
Measurement::convertPressure(1.1, PressureType::BAR, 'invalid');
}
public function testInvalidEnergyPowerFrom() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
Measurement::convertEnergy(1.1, 'invalid', EnergyPowerType::JOULS);
}
public function testInvalidEnergyPowerTo() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
Measurement::convertEnergy(1.1, EnergyPowerType::JOULS, 'invalid');
}
public function testInvalidFileSizeFrom() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
Measurement::convertFileSize(1.1, 'invalid', FileSizeType::KILOBYTE);
}
public function testInvalidFileSizeTo() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
Measurement::convertFileSize(1.1, FileSizeType::KILOBYTE, 'invalid');
}

View File

@ -19,7 +19,7 @@ class DictionaryTest extends \PHPUnit\Framework\TestCase
{
public function testInvalidGetCharacter() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
$dict = new Dictionary();
$dict->get('as');
@ -27,7 +27,7 @@ class DictionaryTest extends \PHPUnit\Framework\TestCase
public function testNotExistingGetCharacter() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
$dict = new Dictionary();
$dict->get('a');
@ -35,7 +35,7 @@ class DictionaryTest extends \PHPUnit\Framework\TestCase
public function testInvalidSetCharacter() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
$dict = new Dictionary();
$dict->set('as', 'test');
@ -43,7 +43,7 @@ class DictionaryTest extends \PHPUnit\Framework\TestCase
public function testInvalidSetDuplicateCharacter() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
$dict = new Dictionary();
$dict->set('a', '1');
@ -52,7 +52,7 @@ class DictionaryTest extends \PHPUnit\Framework\TestCase
public function testInvalidFormattedValue() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
$dict = new Dictionary();
$dict->set('a', '1a');

View File

@ -71,7 +71,7 @@ class CommitTest extends \PHPUnit\Framework\TestCase
public function testDuplicateLineChange() : void
{
self::expectedException(\Exception::class);
self::expectException(\Exception::class);
$commit = new Commit();
$commit->addChanges(__DIR__ . '/CommitTest.php', 1, '<?php', 'test');

View File

@ -61,7 +61,7 @@ class ArrayParserTest extends \PHPUnit\Framework\TestCase
public function testInvalidValueType() : void
{
self::expectedException(\UnexpectedValueException::class);
self::expectException(\UnexpectedValueException::class);
ArrayParser::parseVariable(new class {});
}

View File

@ -49,14 +49,14 @@ class PermutationTest extends \PHPUnit\Framework\TestCase
public function testWrongPermuteParameterType() : void
{
self::expectedException(\InvalidArgumentException::class);
self::expectException(\InvalidArgumentException::class);
Permutation::permutate(4, [2, 1, 1]);
}
public function testWrongPermuteKeyLength() : void
{
self::expectedException(\OutOfBoundsException::class);
self::expectException(\OutOfBoundsException::class);
Permutation::permutate('abc', [2, 1, 1, 6]);
}

View File

@ -119,7 +119,7 @@ class ViewTest extends \PHPUnit\Framework\TestCase
public function testRenderException() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
$view = new View($this->app, new Request(new Http('')), new Response());
$view->setTemplate('something.txt');
@ -129,7 +129,7 @@ class ViewTest extends \PHPUnit\Framework\TestCase
public function testSerializeException() : void
{
self::expectedException(\phpOMS\System\File\PathException::class);
self::expectException(\phpOMS\System\File\PathException::class);
$view = new View($this->app, new Request(new Http('')), new Response());
$view->setTemplate('something.txt');