diff --git a/tests/Account/AccountTest.php b/tests/Account/AccountTest.php index a3e942879..b578ba2c5 100644 --- a/tests/Account/AccountTest.php +++ b/tests/Account/AccountTest.php @@ -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); diff --git a/tests/Account/GroupTest.php b/tests/Account/GroupTest.php index 963b2469d..7bcc62a6f 100644 --- a/tests/Account/GroupTest.php +++ b/tests/Account/GroupTest.php @@ -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); diff --git a/tests/Business/Finance/FinanceFormulasTest.php b/tests/Business/Finance/FinanceFormulasTest.php index 7885628d6..0a283d2dc 100644 --- a/tests/Business/Finance/FinanceFormulasTest.php +++ b/tests/Business/Finance/FinanceFormulasTest.php @@ -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); } diff --git a/tests/DataStorage/Cache/Connection/ConnectionFactoryTest.php b/tests/DataStorage/Cache/Connection/ConnectionFactoryTest.php index 51a1708cb..fd2853fab 100644 --- a/tests/DataStorage/Cache/Connection/ConnectionFactoryTest.php +++ b/tests/DataStorage/Cache/Connection/ConnectionFactoryTest.php @@ -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']); } diff --git a/tests/DataStorage/Cache/Connection/FileCacheTest.php b/tests/DataStorage/Cache/Connection/FileCacheTest.php index bb4083b6b..1f9c53dc9 100644 --- a/tests/DataStorage/Cache/Connection/FileCacheTest.php +++ b/tests/DataStorage/Cache/Connection/FileCacheTest.php @@ -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^$:?><'); } diff --git a/tests/DataStorage/Cache/Connection/MemCachedTest.php b/tests/DataStorage/Cache/Connection/MemCachedTest.php index 29bfc2187..635381eaa 100644 --- a/tests/DataStorage/Cache/Connection/MemCachedTest.php +++ b/tests/DataStorage/Cache/Connection/MemCachedTest.php @@ -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']); diff --git a/tests/DataStorage/Cache/Connection/RedisCacheTest.php b/tests/DataStorage/Cache/Connection/RedisCacheTest.php index 18048762e..1857213f4 100644 --- a/tests/DataStorage/Cache/Connection/RedisCacheTest.php +++ b/tests/DataStorage/Cache/Connection/RedisCacheTest.php @@ -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']); diff --git a/tests/DataStorage/Cookie/CookieJarTest.php b/tests/DataStorage/Cookie/CookieJarTest.php index 42c30fa4c..cc002acb1 100644 --- a/tests/DataStorage/Cookie/CookieJarTest.php +++ b/tests/DataStorage/Cookie/CookieJarTest.php @@ -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(); diff --git a/tests/DataStorage/Database/Connection/ConnectionFactoryTest.php b/tests/DataStorage/Database/Connection/ConnectionFactoryTest.php index 76f993a53..1e6bd6d69 100644 --- a/tests/DataStorage/Database/Connection/ConnectionFactoryTest.php +++ b/tests/DataStorage/Database/Connection/ConnectionFactoryTest.php @@ -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']); } diff --git a/tests/DataStorage/Database/Connection/MysqlConnectionTest.php b/tests/DataStorage/Database/Connection/MysqlConnectionTest.php index 199d7dfda..5e6af4993 100644 --- a/tests/DataStorage/Database/Connection/MysqlConnectionTest.php +++ b/tests/DataStorage/Database/Connection/MysqlConnectionTest.php @@ -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'; diff --git a/tests/DataStorage/Database/Connection/PostgresConnectionTest.php b/tests/DataStorage/Database/Connection/PostgresConnectionTest.php index 758777b9c..f4aec2d1f 100644 --- a/tests/DataStorage/Database/Connection/PostgresConnectionTest.php +++ b/tests/DataStorage/Database/Connection/PostgresConnectionTest.php @@ -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'; diff --git a/tests/DataStorage/Database/Connection/SQLiteConnectionTest.php b/tests/DataStorage/Database/Connection/SQLiteConnectionTest.php index 7e72fd82a..41704d8e9 100644 --- a/tests/DataStorage/Database/Connection/SQLiteConnectionTest.php +++ b/tests/DataStorage/Database/Connection/SQLiteConnectionTest.php @@ -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']); diff --git a/tests/DataStorage/Database/Connection/SqlServerConnectionTest.php b/tests/DataStorage/Database/Connection/SqlServerConnectionTest.php index 51b2c0f1b..021f2f1e9 100644 --- a/tests/DataStorage/Database/Connection/SqlServerConnectionTest.php +++ b/tests/DataStorage/Database/Connection/SqlServerConnectionTest.php @@ -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'; diff --git a/tests/DataStorage/Database/Query/BuilderTest.php b/tests/DataStorage/Database/Query/BuilderTest.php index 7d22e779b..d95e2ecd6 100644 --- a/tests/DataStorage/Database/Query/BuilderTest.php +++ b/tests/DataStorage/Database/Query/BuilderTest.php @@ -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'); diff --git a/tests/DataStorage/File/JsonBuilderTest.php b/tests/DataStorage/File/JsonBuilderTest.php index 80416436f..a9a0b41ef 100644 --- a/tests/DataStorage/File/JsonBuilderTest.php +++ b/tests/DataStorage/File/JsonBuilderTest.php @@ -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'); diff --git a/tests/Dispatcher/DispatcherTest.php b/tests/Dispatcher/DispatcherTest.php index fadb1130e..1043e66c0 100644 --- a/tests/Dispatcher/DispatcherTest.php +++ b/tests/Dispatcher/DispatcherTest.php @@ -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'); } diff --git a/tests/Localization/Defaults/CurrencyMapperTest.php b/tests/Localization/Defaults/CurrencyMapperTest.php index 09e0419d0..ae7ca880c 100644 --- a/tests/Localization/Defaults/CurrencyMapperTest.php +++ b/tests/Localization/Defaults/CurrencyMapperTest.php @@ -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 diff --git a/tests/Localization/L11nManagerTest.php b/tests/Localization/L11nManagerTest.php index d90d586b6..9af6f1d1f 100644 --- a/tests/Localization/L11nManagerTest.php +++ b/tests/Localization/L11nManagerTest.php @@ -37,7 +37,7 @@ class L11nManagerTest extends \PHPUnit\Framework\TestCase public function testInvalidModule() : void { - self::expectedException(\Exception::class); + self::expectException(\Exception::class); $expected = [ 'en' => [ diff --git a/tests/Localization/LocalizationTest.php b/tests/Localization/LocalizationTest.php index 14104544f..1452f80af 100644 --- a/tests/Localization/LocalizationTest.php +++ b/tests/Localization/LocalizationTest.php @@ -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'); diff --git a/tests/Log/FileLoggerTest.php b/tests/Log/FileLoggerTest.php index 62b237eb3..7a62fe7b6 100644 --- a/tests/Log/FileLoggerTest.php +++ b/tests/Log/FileLoggerTest.php @@ -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, [ diff --git a/tests/Math/Matrix/CholeskyDecompositionTest.php b/tests/Math/Matrix/CholeskyDecompositionTest.php index bad6bf776..b0acd75ec 100644 --- a/tests/Math/Matrix/CholeskyDecompositionTest.php +++ b/tests/Math/Matrix/CholeskyDecompositionTest.php @@ -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([ diff --git a/tests/Math/Matrix/EigenvalueDecompositionTest.php b/tests/Math/Matrix/EigenvalueDecompositionTest.php index 1c210261e..469349a23 100644 --- a/tests/Math/Matrix/EigenvalueDecompositionTest.php +++ b/tests/Math/Matrix/EigenvalueDecompositionTest.php @@ -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 ); } } \ No newline at end of file diff --git a/tests/Math/Matrix/LUDecompositionTest.php b/tests/Math/Matrix/LUDecompositionTest.php index 4b82531d2..722455ee5 100644 --- a/tests/Math/Matrix/LUDecompositionTest.php +++ b/tests/Math/Matrix/LUDecompositionTest.php @@ -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([ diff --git a/tests/Math/Matrix/MatrixTest.php b/tests/Math/Matrix/MatrixTest.php index f588b9063..d70e7cd2b 100644 --- a/tests/Math/Matrix/MatrixTest.php +++ b/tests/Math/Matrix/MatrixTest.php @@ -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]]); diff --git a/tests/Math/Matrix/QRDecompositionTest.php b/tests/Math/Matrix/QRDecompositionTest.php index 4c4c4fd86..e8728d774 100644 --- a/tests/Math/Matrix/QRDecompositionTest.php +++ b/tests/Math/Matrix/QRDecompositionTest.php @@ -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 ); } diff --git a/tests/Math/Number/ComplexTest.php b/tests/Math/Number/ComplexTest.php index 2bc06b1ab..fa749de4c 100644 --- a/tests/Math/Number/ComplexTest.php +++ b/tests/Math/Number/ComplexTest.php @@ -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); diff --git a/tests/Math/Number/IntegerTest.php b/tests/Math/Number/IntegerTest.php index 480c6e8ab..0c31f1998 100644 --- a/tests/Math/Number/IntegerTest.php +++ b/tests/Math/Number/IntegerTest.php @@ -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); } diff --git a/tests/Math/Statistic/AverageTest.php b/tests/Math/Statistic/AverageTest.php index b49305272..d8794b58f 100644 --- a/tests/Math/Statistic/AverageTest.php +++ b/tests/Math/Statistic/AverageTest.php @@ -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]); } diff --git a/tests/Math/Statistic/CorrelationTest.php b/tests/Math/Statistic/CorrelationTest.php index 66916293a..eb5c6a4d2 100644 --- a/tests/Math/Statistic/CorrelationTest.php +++ b/tests/Math/Statistic/CorrelationTest.php @@ -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 ); } diff --git a/tests/Math/Statistic/Forecast/Regression/LevelLevelRegressionTest.php b/tests/Math/Statistic/Forecast/Regression/LevelLevelRegressionTest.php index 9c4e62301..55aa658ee 100644 --- a/tests/Math/Statistic/Forecast/Regression/LevelLevelRegressionTest.php +++ b/tests/Math/Statistic/Forecast/Regression/LevelLevelRegressionTest.php @@ -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]; diff --git a/tests/Math/Statistic/Forecast/Regression/LevelLogRegressionTest.php b/tests/Math/Statistic/Forecast/Regression/LevelLogRegressionTest.php index a5ea4e9ca..8b1f8daf3 100644 --- a/tests/Math/Statistic/Forecast/Regression/LevelLogRegressionTest.php +++ b/tests/Math/Statistic/Forecast/Regression/LevelLogRegressionTest.php @@ -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]; diff --git a/tests/Math/Statistic/Forecast/Regression/LogLevelRegressionTest.php b/tests/Math/Statistic/Forecast/Regression/LogLevelRegressionTest.php index c92272070..de4957e45 100644 --- a/tests/Math/Statistic/Forecast/Regression/LogLevelRegressionTest.php +++ b/tests/Math/Statistic/Forecast/Regression/LogLevelRegressionTest.php @@ -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]; diff --git a/tests/Math/Statistic/Forecast/Regression/LogLogRegressionTest.php b/tests/Math/Statistic/Forecast/Regression/LogLogRegressionTest.php index 0f5e5fd3b..d83ecdb93 100644 --- a/tests/Math/Statistic/Forecast/Regression/LogLogRegressionTest.php +++ b/tests/Math/Statistic/Forecast/Regression/LogLogRegressionTest.php @@ -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]; diff --git a/tests/Math/Statistic/MeasureOfDispersionTest.php b/tests/Math/Statistic/MeasureOfDispersionTest.php index 8cc127139..dc1ca7ce7 100644 --- a/tests/Math/Statistic/MeasureOfDispersionTest.php +++ b/tests/Math/Statistic/MeasureOfDispersionTest.php @@ -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([]); } diff --git a/tests/Math/Stochastic/Distribution/ChiSquaredDistributionTest.php b/tests/Math/Stochastic/Distribution/ChiSquaredDistributionTest.php index 56ec37451..c9dcb7dcf 100644 --- a/tests/Math/Stochastic/Distribution/ChiSquaredDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/ChiSquaredDistributionTest.php @@ -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); } diff --git a/tests/Math/Stochastic/Distribution/ExponentialDistributionTest.php b/tests/Math/Stochastic/Distribution/ExponentialDistributionTest.php index 2891756da..fad7ecdaf 100644 --- a/tests/Math/Stochastic/Distribution/ExponentialDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/ExponentialDistributionTest.php @@ -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); } diff --git a/tests/Math/Stochastic/Distribution/LaplaceDistributionTest.php b/tests/Math/Stochastic/Distribution/LaplaceDistributionTest.php index 69c2975a1..04d0dff03 100644 --- a/tests/Math/Stochastic/Distribution/LaplaceDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/LaplaceDistributionTest.php @@ -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); } diff --git a/tests/Math/Stochastic/Distribution/UniformDistributionDiscreteTest.php b/tests/Math/Stochastic/Distribution/UniformDistributionDiscreteTest.php index 6634fd739..818aee6e9 100644 --- a/tests/Math/Stochastic/Distribution/UniformDistributionDiscreteTest.php +++ b/tests/Math/Stochastic/Distribution/UniformDistributionDiscreteTest.php @@ -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); } diff --git a/tests/Message/Console/RequestTest.php b/tests/Message/Console/RequestTest.php index 558e3585d..468b2b064 100644 --- a/tests/Message/Console/RequestTest.php +++ b/tests/Message/Console/RequestTest.php @@ -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'); diff --git a/tests/Message/Http/RequestTest.php b/tests/Message/Http/RequestTest.php index 6499d682d..4a023e93d 100644 --- a/tests/Message/Http/RequestTest.php +++ b/tests/Message/Http/RequestTest.php @@ -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'); diff --git a/tests/Message/Http/RestTest.php b/tests/Message/Http/RestTest.php index 214dad3f8..e1c29cec4 100644 --- a/tests/Message/Http/RestTest.php +++ b/tests/Message/Http/RestTest.php @@ -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( diff --git a/tests/Module/InfoManagerTest.php b/tests/Module/InfoManagerTest.php index 40dd89dcf..d1aee5741 100644 --- a/tests/Module/InfoManagerTest.php +++ b/tests/Module/InfoManagerTest.php @@ -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(); diff --git a/tests/Stdlib/Base/EnumArrayTest.php b/tests/Stdlib/Base/EnumArrayTest.php index 717da5a44..1433285cb 100644 --- a/tests/Stdlib/Base/EnumArrayTest.php +++ b/tests/Stdlib/Base/EnumArrayTest.php @@ -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'); } diff --git a/tests/Stdlib/Base/EnumTest.php b/tests/Stdlib/Base/EnumTest.php index a86f8cb91..62f943fb6 100644 --- a/tests/Stdlib/Base/EnumTest.php +++ b/tests/Stdlib/Base/EnumTest.php @@ -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'); } diff --git a/tests/Stdlib/Base/IbanTest.php b/tests/Stdlib/Base/IbanTest.php index 7216f1a83..b5fb77381 100644 --- a/tests/Stdlib/Base/IbanTest.php +++ b/tests/Stdlib/Base/IbanTest.php @@ -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'); } diff --git a/tests/Stdlib/Queue/PriorityQueueTest.php b/tests/Stdlib/Queue/PriorityQueueTest.php index 607924b48..0dce0a0fa 100644 --- a/tests/Stdlib/Queue/PriorityQueueTest.php +++ b/tests/Stdlib/Queue/PriorityQueueTest.php @@ -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); } diff --git a/tests/System/File/Ftp/DirectoryTest.php b/tests/System/File/Ftp/DirectoryTest.php index f33654f1b..9afef4ed1 100644 --- a/tests/System/File/Ftp/DirectoryTest.php +++ b/tests/System/File/Ftp/DirectoryTest.php @@ -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); diff --git a/tests/System/File/Ftp/FileTest.php b/tests/System/File/Ftp/FileTest.php index d938ea1c5..6439321ba 100644 --- a/tests/System/File/Ftp/FileTest.php +++ b/tests/System/File/Ftp/FileTest.php @@ -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); diff --git a/tests/System/File/Local/DirectoryTest.php b/tests/System/File/Local/DirectoryTest.php index 5211538ac..20821463e 100644 --- a/tests/System/File/Local/DirectoryTest.php +++ b/tests/System/File/Local/DirectoryTest.php @@ -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'); } diff --git a/tests/System/File/Local/FileTest.php b/tests/System/File/Local/FileTest.php index 1e16577a9..ae6932ebc 100644 --- a/tests/System/File/Local/FileTest.php +++ b/tests/System/File/Local/FileTest.php @@ -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'); } diff --git a/tests/System/File/Local/LocalStorageTest.php b/tests/System/File/Local/LocalStorageTest.php index 0f029afa6..bf33c97e0 100644 --- a/tests/System/File/Local/LocalStorageTest.php +++ b/tests/System/File/Local/LocalStorageTest.php @@ -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__); } diff --git a/tests/System/File/PathExceptionTest.php b/tests/System/File/PathExceptionTest.php index 09b6ba601..8cc72f019 100644 --- a/tests/System/File/PathExceptionTest.php +++ b/tests/System/File/PathExceptionTest.php @@ -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'); } diff --git a/tests/System/File/PermissionExceptionTest.php b/tests/System/File/PermissionExceptionTest.php index 9cbc20e46..5d052a74d 100644 --- a/tests/System/File/PermissionExceptionTest.php +++ b/tests/System/File/PermissionExceptionTest.php @@ -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'); } diff --git a/tests/System/File/StorageTest.php b/tests/System/File/StorageTest.php index 78407b91e..9fd71b53d 100644 --- a/tests/System/File/StorageTest.php +++ b/tests/System/File/StorageTest.php @@ -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')); } diff --git a/tests/Utils/Barcode/C128AbstractTest.php b/tests/Utils/Barcode/C128AbstractTest.php index d2111afde..31798ce09 100644 --- a/tests/Utils/Barcode/C128AbstractTest.php +++ b/tests/Utils/Barcode/C128AbstractTest.php @@ -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); } diff --git a/tests/Utils/Barcode/C25Test.php b/tests/Utils/Barcode/C25Test.php index 2c6bdbd7f..e0f87686b 100644 --- a/tests/Utils/Barcode/C25Test.php +++ b/tests/Utils/Barcode/C25Test.php @@ -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'); } diff --git a/tests/Utils/Converter/CurrencyTest.php b/tests/Utils/Converter/CurrencyTest.php index 6a4dd6251..947d298df 100644 --- a/tests/Utils/Converter/CurrencyTest.php +++ b/tests/Utils/Converter/CurrencyTest.php @@ -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'); } diff --git a/tests/Utils/Converter/MeasurementTest.php b/tests/Utils/Converter/MeasurementTest.php index c979c4eaf..47684b372 100644 --- a/tests/Utils/Converter/MeasurementTest.php +++ b/tests/Utils/Converter/MeasurementTest.php @@ -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'); } diff --git a/tests/Utils/Encoding/Huffman/DictionaryTest.php b/tests/Utils/Encoding/Huffman/DictionaryTest.php index 931a43349..f3468181c 100644 --- a/tests/Utils/Encoding/Huffman/DictionaryTest.php +++ b/tests/Utils/Encoding/Huffman/DictionaryTest.php @@ -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'); diff --git a/tests/Utils/Git/CommitTest.php b/tests/Utils/Git/CommitTest.php index 7ac3a2369..47f0c7dce 100644 --- a/tests/Utils/Git/CommitTest.php +++ b/tests/Utils/Git/CommitTest.php @@ -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, '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');