From 50743fecf0c4ea38f88211452e40ca6dc597b0a8 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Mon, 8 Jun 2020 18:20:24 +0200 Subject: [PATCH] fix tests --- DataStorage/Database/DataMapperAbstract.php | 2 +- tests/Account/AccountTest.php | 6 +-- tests/Account/GroupTest.php | 2 +- tests/Application/ApplicationInfoTest.php | 6 +-- .../Connection/ConnectionFactoryTest.php | 2 +- .../Cache/Connection/FileCacheTest.php | 6 +-- .../Cache/Connection/MemCachedTest.php | 8 ++-- .../Cache/Connection/RedisCacheTest.php | 10 ++--- tests/DataStorage/Cookie/CookieJarTest.php | 4 +- .../Connection/ConnectionFactoryTest.php | 2 +- .../Connection/MysqlConnectionTest.php | 2 +- .../Database/Query/BuilderTest.php | 30 ++++++------- tests/Dispatcher/DispatcherTest.php | 8 ++-- tests/Localization/L11nManagerTest.php | 2 +- tests/Localization/LocalizationTest.php | 14 +++--- tests/Log/FileLoggerTest.php | 2 +- .../Math/Matrix/CholeskyDecompositionTest.php | 2 +- tests/Math/Matrix/LUDecompositionTest.php | 4 +- tests/Math/Matrix/MatrixTest.php | 16 +++---- tests/Math/Number/ComplexTest.php | 10 ++--- tests/Math/Number/IntegerTest.php | 2 +- tests/Math/Statistic/AverageTest.php | 12 ++--- .../Regression/LevelLevelRegressionTest.php | 2 +- .../Regression/LevelLogRegressionTest.php | 2 +- .../Regression/LogLevelRegressionTest.php | 2 +- .../Regression/LogLogRegressionTest.php | 2 +- .../Regression/PolynomialRegressionTest.php | 2 +- .../Statistic/MeasureOfDispersionTest.php | 10 ++--- .../ChiSquaredDistributionTest.php | 8 ++-- .../ExponentialDistributionTest.php | 2 +- .../Distribution/LaplaceDistributionTest.php | 2 +- .../UniformDistributionDiscreteTest.php | 4 +- tests/Math/Topology/Metrics2DTest.php | 4 +- tests/Math/Topology/MetricsNDTest.php | 16 +++---- tests/Message/Http/HttpRequestTest.php | 4 +- tests/Module/ModuleInfoTest.php | 6 +-- tests/Module/PackageManagerTest.php | 4 +- tests/Stdlib/Base/EnumArrayTest.php | 2 +- tests/Stdlib/Base/EnumTest.php | 2 +- tests/Stdlib/Base/IbanTest.php | 6 +-- tests/Stdlib/Queue/PriorityQueueTest.php | 2 +- tests/System/File/Ftp/DirectoryTest.php | 6 +-- tests/System/File/Ftp/FileTest.php | 8 ++-- tests/System/File/Local/DirectoryTest.php | 6 +-- tests/System/File/Local/FileTest.php | 8 ++-- tests/System/File/Local/LocalStorageTest.php | 28 ++++++------ tests/System/File/StorageTest.php | 2 +- tests/Utils/Barcode/C128AbstractTest.php | 6 +-- tests/Utils/Barcode/C25Test.php | 2 +- tests/Utils/Converter/CurrencyTest.php | 6 +-- tests/Utils/Converter/MeasurementTest.php | 44 +++++++++---------- .../Utils/Encoding/Huffman/DictionaryTest.php | 10 ++--- tests/Utils/Git/CommitTest.php | 2 +- tests/Utils/Parser/Php/ArrayParserTest.php | 2 +- tests/Utils/PermutationTest.php | 2 +- tests/Views/ViewTest.php | 10 ++--- 56 files changed, 188 insertions(+), 188 deletions(-) diff --git a/DataStorage/Database/DataMapperAbstract.php b/DataStorage/Database/DataMapperAbstract.php index 81754c248..b02c04728 100644 --- a/DataStorage/Database/DataMapperAbstract.php +++ b/DataStorage/Database/DataMapperAbstract.php @@ -2960,7 +2960,7 @@ class DataMapperAbstract implements DataMapperInterface $cachedTables = []; // used by conditionals foreach (static::$hasMany as $member => $value) { - if ($value['writeonly'] ?? false === true || isset($value['column'])) { // @todo: conflict with getQuery()???!?!?!?! + if ($value['writeonly'] ?? false === true) { continue; } diff --git a/tests/Account/AccountTest.php b/tests/Account/AccountTest.php index bc47cbfc8..1c54b31ca 100644 --- a/tests/Account/AccountTest.php +++ b/tests/Account/AccountTest.php @@ -294,7 +294,7 @@ class AccountTest extends \PHPUnit\Framework\TestCase */ public function testEmailException() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $account = new Account(); $account->setEmail('d.duck!@#%@duckburg'); @@ -306,7 +306,7 @@ class AccountTest extends \PHPUnit\Framework\TestCase */ public function testStatusException() : void { - self::expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); + $this->expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); $account = new Account(); @@ -324,7 +324,7 @@ class AccountTest extends \PHPUnit\Framework\TestCase */ public function testTypeException() : void { - self::expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); + $this->expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); $account = new Account(); diff --git a/tests/Account/GroupTest.php b/tests/Account/GroupTest.php index 86185e372..a24b8115a 100644 --- a/tests/Account/GroupTest.php +++ b/tests/Account/GroupTest.php @@ -173,7 +173,7 @@ class GroupTest extends \PHPUnit\Framework\TestCase */ public function testStatusException() : void { - self::expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); + $this->expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); $group = new Group(); diff --git a/tests/Application/ApplicationInfoTest.php b/tests/Application/ApplicationInfoTest.php index 30a318586..fe6af9501 100644 --- a/tests/Application/ApplicationInfoTest.php +++ b/tests/Application/ApplicationInfoTest.php @@ -79,7 +79,7 @@ class ApplicationInfoTest extends \PHPUnit\Framework\TestCase */ public function testInvalidPathLoad() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); $info = new ApplicationInfo(__DIR__ . '/invalid.json'); $info->load(); @@ -92,7 +92,7 @@ class ApplicationInfoTest extends \PHPUnit\Framework\TestCase */ public function testInvalidPathUpdate() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); $info = new ApplicationInfo(__DIR__ . '/invalid.json'); $info->update(); @@ -105,7 +105,7 @@ class ApplicationInfoTest extends \PHPUnit\Framework\TestCase */ public function testInvalidDataSet() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $info = new ApplicationInfo(__DIR__ . '/info-test.json'); $info->load(); diff --git a/tests/DataStorage/Cache/Connection/ConnectionFactoryTest.php b/tests/DataStorage/Cache/Connection/ConnectionFactoryTest.php index 8671fb7d2..e466a9adb 100644 --- a/tests/DataStorage/Cache/Connection/ConnectionFactoryTest.php +++ b/tests/DataStorage/Cache/Connection/ConnectionFactoryTest.php @@ -78,7 +78,7 @@ class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase */ public function testInvalidCacheType() : void { - self::expectException(\InvalidArgumentException::class); + $this->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 d66c1b867..e20f7595d 100644 --- a/tests/DataStorage/Cache/Connection/FileCacheTest.php +++ b/tests/DataStorage/Cache/Connection/FileCacheTest.php @@ -333,7 +333,7 @@ class FileCacheTest extends \PHPUnit\Framework\TestCase */ public function testInvalidCachePath() : void { - self::expectException(\phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException::class); + $this->expectException(\phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException::class); $cache = new FileCache('/etc/invalidPathOrPermission^$:?><'); } @@ -345,7 +345,7 @@ class FileCacheTest extends \PHPUnit\Framework\TestCase */ public function testInvalidDataTypeAdd() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $this->cache->add('invalid', $this->cache); } @@ -357,7 +357,7 @@ class FileCacheTest extends \PHPUnit\Framework\TestCase */ public function testInvalidDataTypeSet() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $this->cache->set('invalid', $this->cache); } diff --git a/tests/DataStorage/Cache/Connection/MemCachedTest.php b/tests/DataStorage/Cache/Connection/MemCachedTest.php index 03c92286a..ca9cb00d9 100644 --- a/tests/DataStorage/Cache/Connection/MemCachedTest.php +++ b/tests/DataStorage/Cache/Connection/MemCachedTest.php @@ -270,7 +270,7 @@ class MemCachedTest extends \PHPUnit\Framework\TestCase */ public function testInvalidDataTypeAdd() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $this->cache->add('invalid', $this->cache); } @@ -282,7 +282,7 @@ class MemCachedTest extends \PHPUnit\Framework\TestCase */ public function testInvalidDataTypeSet() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $this->cache->set('invalid', $this->cache); } @@ -294,7 +294,7 @@ class MemCachedTest extends \PHPUnit\Framework\TestCase */ public function testInvalidCacheHost() : void { - self::expectException(\phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException::class); + $this->expectException(\phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException::class); $db = $GLOBALS['CONFIG']['cache']['memcached']; unset($db['host']); @@ -309,7 +309,7 @@ class MemCachedTest extends \PHPUnit\Framework\TestCase */ public function testInvalidCachePort() : void { - self::expectException(\phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException::class); + $this->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 3aea5dcf8..c1891cdf8 100644 --- a/tests/DataStorage/Cache/Connection/RedisCacheTest.php +++ b/tests/DataStorage/Cache/Connection/RedisCacheTest.php @@ -256,7 +256,7 @@ class RedisCacheTest extends \PHPUnit\Framework\TestCase */ public function testInvalidDataTypeAdd() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $this->cache->add('invalid', $this->cache); } @@ -268,7 +268,7 @@ class RedisCacheTest extends \PHPUnit\Framework\TestCase */ public function testInvalidDataTypeSet() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $this->cache->set('invalid', $this->cache); } @@ -280,7 +280,7 @@ class RedisCacheTest extends \PHPUnit\Framework\TestCase */ public function testInvalidCacheHost() : void { - self::expectException(\phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException::class); + $this->expectException(\phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException::class); $db = $GLOBALS['CONFIG']['cache']['redis']; unset($db['host']); @@ -295,7 +295,7 @@ class RedisCacheTest extends \PHPUnit\Framework\TestCase */ public function testInvalidCachePort() : void { - self::expectException(\phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException::class); + $this->expectException(\phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException::class); $db = $GLOBALS['CONFIG']['cache']['redis']; unset($db['port']); @@ -310,7 +310,7 @@ class RedisCacheTest extends \PHPUnit\Framework\TestCase */ public function testInvalidCacheDatabase() : void { - self::expectException(\phpOMS\DataStorage\Cache\Exception\InvalidConnectionConfigException::class); + $this->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 280277796..14b3b0f59 100644 --- a/tests/DataStorage/Cookie/CookieJarTest.php +++ b/tests/DataStorage/Cookie/CookieJarTest.php @@ -101,7 +101,7 @@ class CookieJarTest extends \PHPUnit\Framework\TestCase */ public function testDeleteLocked() : void { - self::expectException(\phpOMS\DataStorage\LockException::class); + $this->expectException(\phpOMS\DataStorage\LockException::class); self::assertTrue($this->jar->set('test', 'value')); @@ -115,7 +115,7 @@ class CookieJarTest extends \PHPUnit\Framework\TestCase */ public function testSaveLocked() : void { - self::expectException(\phpOMS\DataStorage\LockException::class); + $this->expectException(\phpOMS\DataStorage\LockException::class); CookieJar::lock(); $this->jar->save(); diff --git a/tests/DataStorage/Database/Connection/ConnectionFactoryTest.php b/tests/DataStorage/Database/Connection/ConnectionFactoryTest.php index 1b76092ec..3a73e1c8a 100644 --- a/tests/DataStorage/Database/Connection/ConnectionFactoryTest.php +++ b/tests/DataStorage/Database/Connection/ConnectionFactoryTest.php @@ -118,7 +118,7 @@ class ConnectionFactoryTest extends \PHPUnit\Framework\TestCase */ public function testInvalidDatabaseType() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); ConnectionFactory::create(['db' => 'invalid']); } diff --git a/tests/DataStorage/Database/Connection/MysqlConnectionTest.php b/tests/DataStorage/Database/Connection/MysqlConnectionTest.php index 668bd67d3..38f15f304 100644 --- a/tests/DataStorage/Database/Connection/MysqlConnectionTest.php +++ b/tests/DataStorage/Database/Connection/MysqlConnectionTest.php @@ -160,6 +160,6 @@ class MysqlConnectionTest extends \PHPUnit\Framework\TestCase $db['database'] = 'invalid'; $mysql = new MysqlConnection($db); - self::assertEquals(DatabaseStatus::FAILURE, $mysql->getStatus()); + self::assertEquals(DatabaseStatus::MISSING_DATABASE, $mysql->getStatus()); } } diff --git a/tests/DataStorage/Database/Query/BuilderTest.php b/tests/DataStorage/Database/Query/BuilderTest.php index c9e6fac8f..84aa6346b 100644 --- a/tests/DataStorage/Database/Query/BuilderTest.php +++ b/tests/DataStorage/Database/Query/BuilderTest.php @@ -368,7 +368,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase */ public function testReadOnlyRawDrop() : void { - self::expectException(\Exception::class); + $this->expectException(\Exception::class); $query = new Builder($this->con, true); $query->raw('DROP DATABASE oms;'); @@ -380,7 +380,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase */ public function testReadOnlyRawDelete() : void { - self::expectException(\Exception::class); + $this->expectException(\Exception::class); $query = new Builder($this->con, true); $query->raw('DELETE oms;'); @@ -392,7 +392,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase */ public function testReadOnlyRawCreate() : void { - self::expectException(\Exception::class); + $this->expectException(\Exception::class); $query = new Builder($this->con, true); $query->raw('CREATE oms;'); @@ -404,7 +404,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase */ public function testReadOnlyRawAlter() : void { - self::expectException(\Exception::class); + $this->expectException(\Exception::class); $query = new Builder($this->con, true); $query->raw('ALTER oms;'); @@ -416,7 +416,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase */ public function testReadOnlyInsert() : void { - self::expectException(\Exception::class); + $this->expectException(\Exception::class); $query = new Builder($this->con, true); $query->insert('test'); @@ -428,7 +428,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase */ public function testReadOnlyUpdate() : void { - self::expectException(\Exception::class); + $this->expectException(\Exception::class); $query = new Builder($this->con, true); $query->update(); @@ -440,7 +440,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase */ public function testReadOnlyDelete() : void { - self::expectException(\Exception::class); + $this->expectException(\Exception::class); $query = new Builder($this->con, true); $query->delete(); @@ -452,7 +452,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase */ public function testInvalidSelectParameter() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $query = new Builder($this->con, true); $query->select(false); @@ -464,7 +464,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase */ public function testInvalidFromParameter() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $query = new Builder($this->con, true); $query->from(false); @@ -476,7 +476,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase */ public function testInvalidGroupByParameter() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $query = new Builder($this->con, true); $query->groupBy(false); @@ -488,7 +488,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase */ public function testInvalidWhereOperator() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $query = new Builder($this->con, true); $query->where('a', 'invalid', 'b'); @@ -500,7 +500,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase */ public function testInvalidJoinTable() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $query = new Builder($this->con, true); $query->join(null); @@ -512,7 +512,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase */ public function testInvalidJoinOperator() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $query = new Builder($this->con, true); $query->join('b')->on('a', 'invalid', 'b'); @@ -524,7 +524,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase */ public function testInvalidOrderType() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $query = new Builder($this->con, true); $query->orderBy('a', 1); @@ -536,7 +536,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase */ public function testInvalidOrderColumnType() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $query = new Builder($this->con, true); $query->orderBy(null, 'DESC'); diff --git a/tests/Dispatcher/DispatcherTest.php b/tests/Dispatcher/DispatcherTest.php index d3261429f..d67fe3331 100644 --- a/tests/Dispatcher/DispatcherTest.php +++ b/tests/Dispatcher/DispatcherTest.php @@ -177,7 +177,7 @@ class DispatcherTest extends \PHPUnit\Framework\TestCase */ public function testInvalidDestination() : void { - self::expectException(\UnexpectedValueException::class); + $this->expectException(\UnexpectedValueException::class); $this->app->dispatcher->dispatch(true); } @@ -189,7 +189,7 @@ class DispatcherTest extends \PHPUnit\Framework\TestCase */ public function testInvalidControllerPath() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); $this->app->dispatcher->dispatch('phpOMS\tests\Dispatcher\TestControllers::testFunctionStatic'); } @@ -201,7 +201,7 @@ class DispatcherTest extends \PHPUnit\Framework\TestCase */ public function testInvalidControllerFunction() : void { - self::expectException(\Exception::class); + $this->expectException(\Exception::class); $this->app->dispatcher->dispatch('phpOMS\tests\Dispatcher\TestController::testFunctionStaticINVALID'); } @@ -213,7 +213,7 @@ class DispatcherTest extends \PHPUnit\Framework\TestCase */ public function testInvalidControllerString() : void { - self::expectException(\UnexpectedValueException::class); + $this->expectException(\UnexpectedValueException::class); $this->app->dispatcher->dispatch('phpOMS\tests\Dispatcher\TestController::testFunctionStatic:failure'); } diff --git a/tests/Localization/L11nManagerTest.php b/tests/Localization/L11nManagerTest.php index 3bc3a449d..b5665f6e8 100644 --- a/tests/Localization/L11nManagerTest.php +++ b/tests/Localization/L11nManagerTest.php @@ -165,7 +165,7 @@ class L11nManagerTest extends \PHPUnit\Framework\TestCase */ public function testInvalidModule() : void { - self::expectException(\Exception::class); + $this->expectException(\Exception::class); $expected = [ 'en' => [ diff --git a/tests/Localization/LocalizationTest.php b/tests/Localization/LocalizationTest.php index 5a5294aa1..f7e66e1e1 100644 --- a/tests/Localization/LocalizationTest.php +++ b/tests/Localization/LocalizationTest.php @@ -86,7 +86,7 @@ class LocalizationTest extends \PHPUnit\Framework\TestCase */ public function testInvalidLanguage() : void { - self::expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); + $this->expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); $this->localization->setLanguage('abc'); } @@ -98,7 +98,7 @@ class LocalizationTest extends \PHPUnit\Framework\TestCase */ public function testInvalidCountry() : void { - self::expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); + $this->expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); $this->localization->setCountry('abc'); } @@ -110,7 +110,7 @@ class LocalizationTest extends \PHPUnit\Framework\TestCase */ public function testInvalidTimezone() : void { - self::expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); + $this->expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); $this->localization->setTimezone('abc'); } @@ -122,7 +122,7 @@ class LocalizationTest extends \PHPUnit\Framework\TestCase */ public function testInvalidCurrency() : void { - self::expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); + $this->expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); $this->localization->setCurrency('abc'); } @@ -134,7 +134,7 @@ class LocalizationTest extends \PHPUnit\Framework\TestCase */ public function testInvalidAngle() : void { - self::expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); + $this->expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); $this->localization->setAngle('abc'); } @@ -146,7 +146,7 @@ class LocalizationTest extends \PHPUnit\Framework\TestCase */ public function testInvalidTemperature() : void { - self::expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); + $this->expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); $this->localization->setTemperature('abc'); } @@ -383,7 +383,7 @@ class LocalizationTest extends \PHPUnit\Framework\TestCase */ public function testInvalidLocalizationLoading() : void { - self::expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); + $this->expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); $this->localization->loadFromLanguage('INVALID'); } diff --git a/tests/Log/FileLoggerTest.php b/tests/Log/FileLoggerTest.php index a58e63f6b..2593adf46 100644 --- a/tests/Log/FileLoggerTest.php +++ b/tests/Log/FileLoggerTest.php @@ -357,7 +357,7 @@ class FileLoggerTest extends \PHPUnit\Framework\TestCase */ public function testLogException() : void { - self::expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); + $this->expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); $this->log = new FileLogger(__DIR__ . '/test.log'); $this->log->log('testException', FileLogger::MSG_FULL, [ diff --git a/tests/Math/Matrix/CholeskyDecompositionTest.php b/tests/Math/Matrix/CholeskyDecompositionTest.php index 9a56dec1c..ef8d94207 100644 --- a/tests/Math/Matrix/CholeskyDecompositionTest.php +++ b/tests/Math/Matrix/CholeskyDecompositionTest.php @@ -131,7 +131,7 @@ class CholeskyDecompositionTest extends \PHPUnit\Framework\TestCase */ public function testInvalidDimension() : void { - self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); + $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); $A = new Matrix(); $A->setMatrix([ diff --git a/tests/Math/Matrix/LUDecompositionTest.php b/tests/Math/Matrix/LUDecompositionTest.php index f6ade7629..77a4deeb5 100644 --- a/tests/Math/Matrix/LUDecompositionTest.php +++ b/tests/Math/Matrix/LUDecompositionTest.php @@ -148,7 +148,7 @@ class LUDecompositionTest extends \PHPUnit\Framework\TestCase */ public function testSolveOfSingularMatrix() : void { - self::expectException(\Exception::class); + $this->expectException(\Exception::class); $B = new Matrix(); $B->setMatrix([ @@ -197,7 +197,7 @@ class LUDecompositionTest extends \PHPUnit\Framework\TestCase */ public function testInvalidDimension() : void { - self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); + $this->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 5889271c2..7aff1f486 100644 --- a/tests/Math/Matrix/MatrixTest.php +++ b/tests/Math/Matrix/MatrixTest.php @@ -406,7 +406,7 @@ class MatrixTest extends \PHPUnit\Framework\TestCase */ public function testInvalidSetIndexException() : void { - self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); + $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); $id = new Matrix(); $id->setMatrix([ @@ -423,7 +423,7 @@ class MatrixTest extends \PHPUnit\Framework\TestCase */ public function testInvalidGetIndexException() : void { - self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); + $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); $id = new Matrix(); $id->setMatrix([ @@ -440,7 +440,7 @@ class MatrixTest extends \PHPUnit\Framework\TestCase */ public function testInvalidSub() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $id = new Matrix(); $id->setMatrix([ @@ -458,7 +458,7 @@ class MatrixTest extends \PHPUnit\Framework\TestCase */ public function testInvalidAdd() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $id = new Matrix(); $id->setMatrix([ @@ -476,7 +476,7 @@ class MatrixTest extends \PHPUnit\Framework\TestCase */ public function testInvalidMult() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $id = new Matrix(); $id->setMatrix([ @@ -494,7 +494,7 @@ class MatrixTest extends \PHPUnit\Framework\TestCase */ public function testInvalidDimensionAdd() : void { - self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); + $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); $A = new Matrix(); $A->setMatrix([[1, 2], [3, 4]]); @@ -512,7 +512,7 @@ class MatrixTest extends \PHPUnit\Framework\TestCase */ public function testInvalidDimensionSub() : void { - self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); + $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); $A = new Matrix(); $A->setMatrix([[1, 2], [3, 4]]); @@ -530,7 +530,7 @@ class MatrixTest extends \PHPUnit\Framework\TestCase */ public function testInvalidDimensionMult() : void { - self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); + $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); $A = new Matrix(); $A->setMatrix([[1, 2], [3, 4]]); diff --git a/tests/Math/Number/ComplexTest.php b/tests/Math/Number/ComplexTest.php index 23a32c960..69376c622 100644 --- a/tests/Math/Number/ComplexTest.php +++ b/tests/Math/Number/ComplexTest.php @@ -227,7 +227,7 @@ class ComplexTest extends \PHPUnit\Framework\TestCase */ public function testInvalidAdd() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $cpl = new Complex(4, 3); $cpl->add(true); @@ -240,7 +240,7 @@ class ComplexTest extends \PHPUnit\Framework\TestCase */ public function testInvalidSub() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $cpl = new Complex(4, 3); $cpl->sub(true); @@ -253,7 +253,7 @@ class ComplexTest extends \PHPUnit\Framework\TestCase */ public function testInvalidMult() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $cpl = new Complex(4, 3); $cpl->mult(true); @@ -266,7 +266,7 @@ class ComplexTest extends \PHPUnit\Framework\TestCase */ public function testInvalidDiv() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $cpl = new Complex(4, 3); $cpl->div(true); @@ -279,7 +279,7 @@ class ComplexTest extends \PHPUnit\Framework\TestCase */ public function testInvalidPow() : void { - self::expectException(\InvalidArgumentException::class); + $this->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 cecef3969..e7881450b 100644 --- a/tests/Math/Number/IntegerTest.php +++ b/tests/Math/Number/IntegerTest.php @@ -94,7 +94,7 @@ class IntegerTest extends \PHPUnit\Framework\TestCase */ public function testInvalidFermatParameter() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); Integer::fermatFactor(8); } diff --git a/tests/Math/Statistic/AverageTest.php b/tests/Math/Statistic/AverageTest.php index b5cdf83d4..e58b5ffa6 100644 --- a/tests/Math/Statistic/AverageTest.php +++ b/tests/Math/Statistic/AverageTest.php @@ -121,7 +121,7 @@ class AverageTest extends \PHPUnit\Framework\TestCase */ public function testInvalidWeightedAverageDimension() : void { - self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); + $this->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]); } @@ -132,7 +132,7 @@ class AverageTest extends \PHPUnit\Framework\TestCase */ public function testInvalidArithmeticMeanZeroDivision() : void { - self::expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); + $this->expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); Average::arithmeticMean([]); } @@ -143,7 +143,7 @@ class AverageTest extends \PHPUnit\Framework\TestCase */ public function testInvalidMovingAverageZeroDivision() : void { - self::expectException(\Exception::class); + $this->expectException(\Exception::class); Average::movingAverage([], 4, 2); } @@ -154,7 +154,7 @@ class AverageTest extends \PHPUnit\Framework\TestCase */ public function testInvalidHarmonicMeanZeroDivision() : void { - self::expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); + $this->expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); Average::harmonicMean([]); } @@ -165,7 +165,7 @@ class AverageTest extends \PHPUnit\Framework\TestCase */ public function testInvalidGeometricMean() : void { - self::expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); + $this->expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); Average::geometricMean([]); } @@ -176,7 +176,7 @@ class AverageTest extends \PHPUnit\Framework\TestCase */ public function testInvalidHarmonicMean() : void { - self::expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); + $this->expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); Average::harmonicMean([1, 2, 3, 0, 5, 6, 7]); } diff --git a/tests/Math/Statistic/Forecast/Regression/LevelLevelRegressionTest.php b/tests/Math/Statistic/Forecast/Regression/LevelLevelRegressionTest.php index f9ad1884e..c3ee62e2b 100644 --- a/tests/Math/Statistic/Forecast/Regression/LevelLevelRegressionTest.php +++ b/tests/Math/Statistic/Forecast/Regression/LevelLevelRegressionTest.php @@ -131,7 +131,7 @@ class LevelLevelRegressionTest extends \PHPUnit\Framework\TestCase */ public function testInvalidDimension() : void { - self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); + $this->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 b051a717a..a0a5ae112 100644 --- a/tests/Math/Statistic/Forecast/Regression/LevelLogRegressionTest.php +++ b/tests/Math/Statistic/Forecast/Regression/LevelLogRegressionTest.php @@ -69,7 +69,7 @@ class LevelLogRegressionTest extends \PHPUnit\Framework\TestCase */ public function testInvalidDimension() : void { - self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); + $this->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 140742fc4..79b283175 100644 --- a/tests/Math/Statistic/Forecast/Regression/LogLevelRegressionTest.php +++ b/tests/Math/Statistic/Forecast/Regression/LogLevelRegressionTest.php @@ -69,7 +69,7 @@ class LogLevelRegressionTest extends \PHPUnit\Framework\TestCase */ public function testInvalidDimension() : void { - self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); + $this->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 d9147ae8f..70d4a6887 100644 --- a/tests/Math/Statistic/Forecast/Regression/LogLogRegressionTest.php +++ b/tests/Math/Statistic/Forecast/Regression/LogLogRegressionTest.php @@ -69,7 +69,7 @@ class LogLogRegressionTest extends \PHPUnit\Framework\TestCase */ public function testInvalidDimension() : void { - self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); + $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); $x = [1,2, 3]; $y = [1,2, 3, 4]; diff --git a/tests/Math/Statistic/Forecast/Regression/PolynomialRegressionTest.php b/tests/Math/Statistic/Forecast/Regression/PolynomialRegressionTest.php index 9564eb95b..5625a36d2 100644 --- a/tests/Math/Statistic/Forecast/Regression/PolynomialRegressionTest.php +++ b/tests/Math/Statistic/Forecast/Regression/PolynomialRegressionTest.php @@ -49,7 +49,7 @@ class PolynomialRegressionTest extends \PHPUnit\Framework\TestCase */ public function testInvalidDimension() : void { - self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); + $this->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 79f7c2ff7..dba958e5f 100644 --- a/tests/Math/Statistic/MeasureOfDispersionTest.php +++ b/tests/Math/Statistic/MeasureOfDispersionTest.php @@ -135,7 +135,7 @@ class MeasureOfDispersionTest extends \PHPUnit\Framework\TestCase */ public function testInvalidEmpiricalVariationCoefficient() : void { - self::expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); + $this->expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); MeasureOfDispersion::empiricalVariationCoefficient([1, 2, 3, 4, 5, 6, 7], 0); } @@ -146,7 +146,7 @@ class MeasureOfDispersionTest extends \PHPUnit\Framework\TestCase */ public function testInvalidEmpiricalCovariance() : void { - self::expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); + $this->expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); MeasureOfDispersion::empiricalCovariance([], []); } @@ -157,7 +157,7 @@ class MeasureOfDispersionTest extends \PHPUnit\Framework\TestCase */ public function testInvalidEmpiricalCovarianceDimension() : void { - self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); + $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); MeasureOfDispersion::empiricalCovariance([1, 2, 3, 4], [1, 2, 3]); } @@ -168,7 +168,7 @@ class MeasureOfDispersionTest extends \PHPUnit\Framework\TestCase */ public function testInvalidSampleVariance() : void { - self::expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); + $this->expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); MeasureOfDispersion::sampleVariance([]); } @@ -179,7 +179,7 @@ class MeasureOfDispersionTest extends \PHPUnit\Framework\TestCase */ public function testInvalidEmpiricalVariance() : void { - self::expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); + $this->expectException(\phpOMS\Math\Exception\ZeroDivisionException::class); MeasureOfDispersion::empiricalVariance([]); } diff --git a/tests/Math/Stochastic/Distribution/ChiSquaredDistributionTest.php b/tests/Math/Stochastic/Distribution/ChiSquaredDistributionTest.php index 2c384e988..d583e1687 100644 --- a/tests/Math/Stochastic/Distribution/ChiSquaredDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/ChiSquaredDistributionTest.php @@ -105,28 +105,28 @@ class ChiSquaredDistributionTest extends \PHPUnit\Framework\TestCase public function testHypothesisSizeException() : void { - self::expectException(\Exception::class); + $this->expectException(\Exception::class); ChiSquaredDistribution::testHypothesis([1, 2], [2]); } public function testHypothesisDegreesOfFreedomException() : void { - self::expectException(\Exception::class); + $this->expectException(\Exception::class); ChiSquaredDistribution::testHypothesis([], []); } public function testPdfOutOfBoundsException() : void { - self::expectException(\OutOfBoundsException::class); + $this->expectException(\OutOfBoundsException::class); ChiSquaredDistribution::getPdf(-1, 0); } public function testMgfOutOfBoundsException() : void { - self::expectException(\OutOfBoundsException::class); + $this->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 7c27315a4..b84471e7c 100644 --- a/tests/Math/Stochastic/Distribution/ExponentialDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/ExponentialDistributionTest.php @@ -82,7 +82,7 @@ class ExponentialDistributionTest extends \PHPUnit\Framework\TestCase public function testMgfException() : void { - self::expectException(\OutOfBoundsException::class); + $this->expectException(\OutOfBoundsException::class); ExponentialDistribution::getMgf(3, 3); } diff --git a/tests/Math/Stochastic/Distribution/LaplaceDistributionTest.php b/tests/Math/Stochastic/Distribution/LaplaceDistributionTest.php index da7b6f704..23c3421c8 100644 --- a/tests/Math/Stochastic/Distribution/LaplaceDistributionTest.php +++ b/tests/Math/Stochastic/Distribution/LaplaceDistributionTest.php @@ -89,7 +89,7 @@ class LaplaceDistributionTest extends \PHPUnit\Framework\TestCase public function testMgfException() : void { - self::expectException(\OutOfBoundsException::class); + $this->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 b6326bb39..b1d2df219 100644 --- a/tests/Math/Stochastic/Distribution/UniformDistributionDiscreteTest.php +++ b/tests/Math/Stochastic/Distribution/UniformDistributionDiscreteTest.php @@ -86,14 +86,14 @@ class UniformDistributionDiscreteTest extends \PHPUnit\Framework\TestCase public function testCdfExceptionUpper() : void { - self::expectException(\OutOfBoundsException::class); + $this->expectException(\OutOfBoundsException::class); UniformDistributionDiscrete::getCdf(5, 2, 4); } public function testCdfExceptionLower() : void { - self::expectException(\OutOfBoundsException::class); + $this->expectException(\OutOfBoundsException::class); UniformDistributionDiscrete::getCdf(1, 2, 4); } diff --git a/tests/Math/Topology/Metrics2DTest.php b/tests/Math/Topology/Metrics2DTest.php index 5346ce96a..a121956f5 100644 --- a/tests/Math/Topology/Metrics2DTest.php +++ b/tests/Math/Topology/Metrics2DTest.php @@ -166,7 +166,7 @@ class Metrics2DTest extends \PHPUnit\Framework\TestCase */ public function testInvalidHammingDimension() : void { - self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); + $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); Metrics2D::hamming([1, 1, 1, 1], [0, 1, 0]); } @@ -178,7 +178,7 @@ class Metrics2DTest extends \PHPUnit\Framework\TestCase */ public function testInvalidUlamDimension() : void { - self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); + $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); Metrics2D::ulam([3, 6, 4], [4, 6, 8, 3]); } diff --git a/tests/Math/Topology/MetricsNDTest.php b/tests/Math/Topology/MetricsNDTest.php index ad5903097..91e3a47e6 100644 --- a/tests/Math/Topology/MetricsNDTest.php +++ b/tests/Math/Topology/MetricsNDTest.php @@ -140,7 +140,7 @@ class MetricsNDTest extends \PHPUnit\Framework\TestCase */ public function testInvalidManhattanDimension() : void { - self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); + $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); MetricsND::manhattan([3, 6, 4], [4, 6, 8, 3]); } @@ -152,7 +152,7 @@ class MetricsNDTest extends \PHPUnit\Framework\TestCase */ public function testInvalidEuclideanDimension() : void { - self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); + $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); MetricsND::euclidean([3, 6, 4], [4, 6, 8, 3]); } @@ -164,7 +164,7 @@ class MetricsNDTest extends \PHPUnit\Framework\TestCase */ public function testInvalidChebyshevDimension() : void { - self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); + $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); MetricsND::chebyshev([3, 6, 4], [4, 6, 8, 3]); } @@ -176,7 +176,7 @@ class MetricsNDTest extends \PHPUnit\Framework\TestCase */ public function testInvalidMinkowskiDimension() : void { - self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); + $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); MetricsND::minkowski([3, 6, 4], [4, 6, 8, 3], 2); } @@ -188,7 +188,7 @@ class MetricsNDTest extends \PHPUnit\Framework\TestCase */ public function testInvalidCanberraDimension() : void { - self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); + $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); MetricsND::canberra([3, 6, 4], [4, 6, 8, 3]); } @@ -200,7 +200,7 @@ class MetricsNDTest extends \PHPUnit\Framework\TestCase */ public function testInvalidBrayCurtisDimension() : void { - self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); + $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); MetricsND::brayCurtis([3, 6, 4], [4, 6, 8, 3]); } @@ -212,7 +212,7 @@ class MetricsNDTest extends \PHPUnit\Framework\TestCase */ public function testInvalidAngularSeparationDimension() : void { - self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); + $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); MetricsND::angularSeparation([3, 6, 4], [4, 6, 8, 3]); } @@ -224,7 +224,7 @@ class MetricsNDTest extends \PHPUnit\Framework\TestCase */ public function testInvalidHammingDimension() : void { - self::expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); + $this->expectException(\phpOMS\Math\Matrix\Exception\InvalidDimensionException::class); MetricsND::hamming([3, 6, 4], [4, 6, 8, 3]); } diff --git a/tests/Message/Http/HttpRequestTest.php b/tests/Message/Http/HttpRequestTest.php index 405817305..392a73082 100644 --- a/tests/Message/Http/HttpRequestTest.php +++ b/tests/Message/Http/HttpRequestTest.php @@ -520,7 +520,7 @@ class HttpRequestTest extends \PHPUnit\Framework\TestCase */ public function testInvalidHttpsPort() : void { - self::expectException(\OutOfRangeException::class); + $this->expectException(\OutOfRangeException::class); $request = new HttpRequest(new HttpUri('http://www.google.com/test/path')); $request->isHttps(-1); @@ -533,7 +533,7 @@ class HttpRequestTest extends \PHPUnit\Framework\TestCase */ public function testInvalidRouteVerb() : void { - self::expectException(\Exception::class); + $this->expectException(\Exception::class); $request = new HttpRequest(new HttpUri('http://www.google.com/test/path')); $request->setMethod('failure'); diff --git a/tests/Module/ModuleInfoTest.php b/tests/Module/ModuleInfoTest.php index 74306b605..a76798dbc 100644 --- a/tests/Module/ModuleInfoTest.php +++ b/tests/Module/ModuleInfoTest.php @@ -81,7 +81,7 @@ class ModuleInfoTest extends \PHPUnit\Framework\TestCase */ public function testInvalidPathLoad() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); $info = new ModuleInfo(__DIR__ . '/invalid.json'); $info->load(); @@ -94,7 +94,7 @@ class ModuleInfoTest extends \PHPUnit\Framework\TestCase */ public function testInvalidPathUpdate() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); $info = new ModuleInfo(__DIR__ . '/invalid.json'); $info->update(); @@ -107,7 +107,7 @@ class ModuleInfoTest extends \PHPUnit\Framework\TestCase */ public function testInvalidDataSet() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $info = new ModuleInfo(__DIR__ . '/info-test.json'); $info->load(); diff --git a/tests/Module/PackageManagerTest.php b/tests/Module/PackageManagerTest.php index 35b5f39a2..7e3838119 100644 --- a/tests/Module/PackageManagerTest.php +++ b/tests/Module/PackageManagerTest.php @@ -146,7 +146,7 @@ class PackageManagerTest extends \PHPUnit\Framework\TestCase */ public function testNotExtractedLoad() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); $package = new PackageManager( __DIR__ . '/testPackage.zip', @@ -164,7 +164,7 @@ class PackageManagerTest extends \PHPUnit\Framework\TestCase */ public function testInvalidInstall() : void { - self::expectException(\Exception::class); + $this->expectException(\Exception::class); $package = new PackageManager( __DIR__ . '/testPackage.zip', diff --git a/tests/Stdlib/Base/EnumArrayTest.php b/tests/Stdlib/Base/EnumArrayTest.php index ac68ada86..51c1e14f4 100644 --- a/tests/Stdlib/Base/EnumArrayTest.php +++ b/tests/Stdlib/Base/EnumArrayTest.php @@ -90,7 +90,7 @@ class EnumArrayTest extends \PHPUnit\Framework\TestCase */ public function testInvalidConstantException() : void { - self::expectException(\OutOfBoundsException::class); + $this->expectException(\OutOfBoundsException::class); EnumArrayDemo::get('enum2'); } diff --git a/tests/Stdlib/Base/EnumTest.php b/tests/Stdlib/Base/EnumTest.php index 8cc1a88d1..3e4a6dba2 100644 --- a/tests/Stdlib/Base/EnumTest.php +++ b/tests/Stdlib/Base/EnumTest.php @@ -144,7 +144,7 @@ class EnumTest extends \PHPUnit\Framework\TestCase */ public function testInvalidConstantException() : void { - self::expectException(\Exception::class); + $this->expectException(\Exception::class); EnumDemo::getByName('ENUM3'); } diff --git a/tests/Stdlib/Base/IbanTest.php b/tests/Stdlib/Base/IbanTest.php index ab5685f61..dd3761024 100644 --- a/tests/Stdlib/Base/IbanTest.php +++ b/tests/Stdlib/Base/IbanTest.php @@ -73,7 +73,7 @@ class IbanTest extends \PHPUnit\Framework\TestCase */ public function testInvalidIbanCountry() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $iban = new Iban('ZZ22 6008 0000 0960 0280 00'); } @@ -85,7 +85,7 @@ class IbanTest extends \PHPUnit\Framework\TestCase */ public function testInvalidIbanLength() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $iban = new Iban('DE22 6008 0000 0960 0280 0'); } @@ -97,7 +97,7 @@ class IbanTest extends \PHPUnit\Framework\TestCase */ public function testInvalidIbanChecksum() : void { - self::expectException(\InvalidArgumentException::class); + $this->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 7365453f2..62b8ce2cb 100644 --- a/tests/Stdlib/Queue/PriorityQueueTest.php +++ b/tests/Stdlib/Queue/PriorityQueueTest.php @@ -287,7 +287,7 @@ class PriorityQueueTest extends \PHPUnit\Framework\TestCase */ public function testInvalidPriority() : void { - self::expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); + $this->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 48291814b..162dac151 100644 --- a/tests/System/File/Ftp/DirectoryTest.php +++ b/tests/System/File/Ftp/DirectoryTest.php @@ -394,7 +394,7 @@ class DirectoryTest extends \PHPUnit\Framework\TestCase */ public function testInvalidCreatedPath() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); Directory::created($this->con, __DIR__ . '/invalid'); } @@ -406,7 +406,7 @@ class DirectoryTest extends \PHPUnit\Framework\TestCase */ public function testInvalidChangedPath() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); Directory::changed($this->con, __DIR__ . '/invalid'); } @@ -418,7 +418,7 @@ class DirectoryTest extends \PHPUnit\Framework\TestCase */ public function testInvalidOwnerPath() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); Directory::owner($this->con, __DIR__ . '/invalid'); } diff --git a/tests/System/File/Ftp/FileTest.php b/tests/System/File/Ftp/FileTest.php index 26cc7db84..9430a9a12 100644 --- a/tests/System/File/Ftp/FileTest.php +++ b/tests/System/File/Ftp/FileTest.php @@ -590,7 +590,7 @@ class FileTest extends \PHPUnit\Framework\TestCase */ public function testInvalidGetPath() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); File::get($this->con, __DIR__ . '/invalid.txt'); } @@ -602,7 +602,7 @@ class FileTest extends \PHPUnit\Framework\TestCase */ public function testInvalidCreatedPath() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); File::created($this->con, __DIR__ . '/invalid.txt'); } @@ -614,7 +614,7 @@ class FileTest extends \PHPUnit\Framework\TestCase */ public function testInvalidChangedPath() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); File::changed($this->con, __DIR__ . '/invalid.txt'); } @@ -626,7 +626,7 @@ class FileTest extends \PHPUnit\Framework\TestCase */ public function testInvalidOwnerPath() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); File::owner($this->con, __DIR__ . '/invalid.txt'); } diff --git a/tests/System/File/Local/DirectoryTest.php b/tests/System/File/Local/DirectoryTest.php index 22b821dba..a73790553 100644 --- a/tests/System/File/Local/DirectoryTest.php +++ b/tests/System/File/Local/DirectoryTest.php @@ -394,7 +394,7 @@ class DirectoryTest extends \PHPUnit\Framework\TestCase */ public function testInvalidCreatedPath() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); Directory::created(__DIR__ . '/invalid'); } @@ -406,7 +406,7 @@ class DirectoryTest extends \PHPUnit\Framework\TestCase */ public function testInvalidChangedPath() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); Directory::changed(__DIR__ . '/invalid'); } @@ -418,7 +418,7 @@ class DirectoryTest extends \PHPUnit\Framework\TestCase */ public function testInvalidOwnerPath() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->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 a5aea6323..d1251d998 100644 --- a/tests/System/File/Local/FileTest.php +++ b/tests/System/File/Local/FileTest.php @@ -573,7 +573,7 @@ class FileTest extends \PHPUnit\Framework\TestCase */ public function testInvalidGetPath() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); File::get(__DIR__ . '/invalid.txt'); } @@ -585,7 +585,7 @@ class FileTest extends \PHPUnit\Framework\TestCase */ public function testInvalidCreatedPath() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); File::created(__DIR__ . '/invalid.txt'); } @@ -597,7 +597,7 @@ class FileTest extends \PHPUnit\Framework\TestCase */ public function testInvalidChangedPath() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); File::changed(__DIR__ . '/invalid.txt'); } @@ -609,7 +609,7 @@ class FileTest extends \PHPUnit\Framework\TestCase */ public function testInvalidOwnerPath() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->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 d1a791c5a..84895fa77 100644 --- a/tests/System/File/Local/LocalStorageTest.php +++ b/tests/System/File/Local/LocalStorageTest.php @@ -364,7 +364,7 @@ class LocalStorageTest extends \PHPUnit\Framework\TestCase */ public function testInvalidCreatedPathDirectory() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); LocalStorage::created(__DIR__ . '/invalid'); } @@ -376,7 +376,7 @@ class LocalStorageTest extends \PHPUnit\Framework\TestCase */ public function testInvalidChangedPathDirectory() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); LocalStorage::changed(__DIR__ . '/invalid'); } @@ -388,7 +388,7 @@ class LocalStorageTest extends \PHPUnit\Framework\TestCase */ public function testInvalidOwnerPathDirectory() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); LocalStorage::owner(__DIR__ . '/invalid'); } @@ -942,7 +942,7 @@ class LocalStorageTest extends \PHPUnit\Framework\TestCase */ public function testInvalidGetPathFile() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); LocalStorage::get(__DIR__ . '/invalid.txt'); } @@ -954,7 +954,7 @@ class LocalStorageTest extends \PHPUnit\Framework\TestCase */ public function testInvalidCreatedPathFile() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); LocalStorage::created(__DIR__ . '/invalid.txt'); } @@ -966,7 +966,7 @@ class LocalStorageTest extends \PHPUnit\Framework\TestCase */ public function testInvalidChangedPathFile() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); LocalStorage::changed(__DIR__ . '/invalid.txt'); } @@ -978,7 +978,7 @@ class LocalStorageTest extends \PHPUnit\Framework\TestCase */ public function testInvalidOwnerPathFile() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); LocalStorage::owner(__DIR__ . '/invalid.txt'); } @@ -990,7 +990,7 @@ class LocalStorageTest extends \PHPUnit\Framework\TestCase */ public function testInvalidPutPath() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); LocalStorage::put(__DIR__, 'Test'); } @@ -1002,7 +1002,7 @@ class LocalStorageTest extends \PHPUnit\Framework\TestCase */ public function testInvalidGetPath() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); LocalStorage::get(__DIR__); } @@ -1014,7 +1014,7 @@ class LocalStorageTest extends \PHPUnit\Framework\TestCase */ public function testInvalidListPath() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); LocalStorage::list(__DIR__ . '/LocalStorageTest.php'); } @@ -1026,7 +1026,7 @@ class LocalStorageTest extends \PHPUnit\Framework\TestCase */ public function testInvalidSetPath() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); LocalStorage::set(__DIR__, 'Test'); } @@ -1038,7 +1038,7 @@ class LocalStorageTest extends \PHPUnit\Framework\TestCase */ public function testInvalidAppendPath() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); LocalStorage::append(__DIR__, 'Test'); } @@ -1050,7 +1050,7 @@ class LocalStorageTest extends \PHPUnit\Framework\TestCase */ public function testInvalidPrependPath() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); LocalStorage::prepend(__DIR__, 'Test'); } @@ -1062,7 +1062,7 @@ class LocalStorageTest extends \PHPUnit\Framework\TestCase */ public function testInvalidExtensionPath() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); LocalStorage::extension(__DIR__); } diff --git a/tests/System/File/StorageTest.php b/tests/System/File/StorageTest.php index 7840e5b45..f4f14fb06 100644 --- a/tests/System/File/StorageTest.php +++ b/tests/System/File/StorageTest.php @@ -76,7 +76,7 @@ class StorageTest extends \PHPUnit\Framework\TestCase */ public function testInvalidStorage() : void { - self::expectException(\Exception::class); + $this->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 097b54d6e..c4d9cb8b6 100644 --- a/tests/Utils/Barcode/C128AbstractTest.php +++ b/tests/Utils/Barcode/C128AbstractTest.php @@ -36,21 +36,21 @@ class C128AbstractTest extends \PHPUnit\Framework\TestCase public function testInvalidDimensionWidth() : void { - self::expectException(\OutOfBoundsException::class); + $this->expectException(\OutOfBoundsException::class); $this->obj->setDimension(-2, 1); } public function testInvalidDimensionHeight() : void { - self::expectException(\OutOfBoundsException::class); + $this->expectException(\OutOfBoundsException::class); $this->obj->setDimension(1, -2); } public function testInvalidOrientation() : void { - self::expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); + $this->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 79e504f68..821d681e0 100644 --- a/tests/Utils/Barcode/C25Test.php +++ b/tests/Utils/Barcode/C25Test.php @@ -79,7 +79,7 @@ class C25Test extends \PHPUnit\Framework\TestCase public function testInvalidOrientation() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $img = new C25('45f!a?12'); } diff --git a/tests/Utils/Converter/CurrencyTest.php b/tests/Utils/Converter/CurrencyTest.php index 81e0bb9a1..344605bc4 100644 --- a/tests/Utils/Converter/CurrencyTest.php +++ b/tests/Utils/Converter/CurrencyTest.php @@ -66,7 +66,7 @@ class CurrencyTest extends \PHPUnit\Framework\TestCase */ public function testInvalidFromEur() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); Currency::fromEurTo(1, 'ERROR'); } @@ -79,7 +79,7 @@ class CurrencyTest extends \PHPUnit\Framework\TestCase */ public function testInvalidToEur() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); Currency::fromToEur(1, 'ERROR'); } @@ -92,7 +92,7 @@ class CurrencyTest extends \PHPUnit\Framework\TestCase */ public function testInvalidConvert() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); Currency::convertCurrency(1, 'ERROR', 'TEST'); } diff --git a/tests/Utils/Converter/MeasurementTest.php b/tests/Utils/Converter/MeasurementTest.php index cffb76dab..0d1731bd3 100644 --- a/tests/Utils/Converter/MeasurementTest.php +++ b/tests/Utils/Converter/MeasurementTest.php @@ -272,7 +272,7 @@ class MeasurementTest extends \PHPUnit\Framework\TestCase */ public function testInvalidTemperatureFrom() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); Measurement::convertTemperature(1.1, 'invalid', TemperatureType::CELSIUS); } @@ -284,7 +284,7 @@ class MeasurementTest extends \PHPUnit\Framework\TestCase */ public function testInvalidTemperatureTo() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); Measurement::convertTemperature(1.1, TemperatureType::CELSIUS, 'invalid'); } @@ -296,7 +296,7 @@ class MeasurementTest extends \PHPUnit\Framework\TestCase */ public function testInvalidWeightFrom() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); Measurement::convertWeight(1.1, 'invalid', WeightType::KILOGRAM); } @@ -308,7 +308,7 @@ class MeasurementTest extends \PHPUnit\Framework\TestCase */ public function testInvalidWeightTo() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); Measurement::convertWeight(1.1, WeightType::KILOGRAM, 'invalid'); } @@ -320,7 +320,7 @@ class MeasurementTest extends \PHPUnit\Framework\TestCase */ public function testInvalidLengthFrom() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); Measurement::convertLength(1.1, 'invalid', LengthType::METERS); } @@ -332,7 +332,7 @@ class MeasurementTest extends \PHPUnit\Framework\TestCase */ public function testInvalidLengthTo() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); Measurement::convertLength(1.1, LengthType::METERS, 'invalid'); } @@ -344,7 +344,7 @@ class MeasurementTest extends \PHPUnit\Framework\TestCase */ public function testInvalidAreaFrom() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); Measurement::convertArea(1.1, 'invalid', AreaType::SQUARE_METERS); } @@ -356,7 +356,7 @@ class MeasurementTest extends \PHPUnit\Framework\TestCase */ public function testInvalidAreaTo() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); Measurement::convertArea(1.1, AreaType::SQUARE_METERS, 'invalid'); } @@ -368,7 +368,7 @@ class MeasurementTest extends \PHPUnit\Framework\TestCase */ public function testInvalidVolumeFrom() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); Measurement::convertVolume(1.1, 'invalid', VolumeType::LITER); } @@ -380,7 +380,7 @@ class MeasurementTest extends \PHPUnit\Framework\TestCase */ public function testInvalidVolumeTo() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); Measurement::convertVolume(1.1, VolumeType::LITER, 'invalid'); } @@ -392,7 +392,7 @@ class MeasurementTest extends \PHPUnit\Framework\TestCase */ public function testInvalidSpeedFrom() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); Measurement::convertSpeed(1.1, 'invalid', SpeedType::KILOMETERS_PER_HOUR); } @@ -404,7 +404,7 @@ class MeasurementTest extends \PHPUnit\Framework\TestCase */ public function testInvalidSpeedTo() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); Measurement::convertSpeed(1.1, SpeedType::KILOMETERS_PER_HOUR, 'invalid'); } @@ -416,7 +416,7 @@ class MeasurementTest extends \PHPUnit\Framework\TestCase */ public function testInvalidTimeFrom() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); Measurement::convertTime(1.1, 'invalid', TimeType::HOURS); } @@ -428,7 +428,7 @@ class MeasurementTest extends \PHPUnit\Framework\TestCase */ public function testInvalidTimeTo() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); Measurement::convertTime(1.1, TimeType::HOURS, 'invalid'); } @@ -440,7 +440,7 @@ class MeasurementTest extends \PHPUnit\Framework\TestCase */ public function testInvalidAngleFrom() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); Measurement::convertAngle(1.1, 'invalid', AngleType::RADIAN); } @@ -452,7 +452,7 @@ class MeasurementTest extends \PHPUnit\Framework\TestCase */ public function testInvalidAngleTo() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); Measurement::convertAngle(1.1, AngleType::RADIAN, 'invalid'); } @@ -464,7 +464,7 @@ class MeasurementTest extends \PHPUnit\Framework\TestCase */ public function testInvalidPressureFrom() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); Measurement::convertPressure(1.1, 'invalid', PressureType::BAR); } @@ -476,7 +476,7 @@ class MeasurementTest extends \PHPUnit\Framework\TestCase */ public function testInvalidPressureTo() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); Measurement::convertPressure(1.1, PressureType::BAR, 'invalid'); } @@ -488,7 +488,7 @@ class MeasurementTest extends \PHPUnit\Framework\TestCase */ public function testInvalidEnergyPowerFrom() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); Measurement::convertEnergy(1.1, 'invalid', EnergyPowerType::JOULS); } @@ -500,7 +500,7 @@ class MeasurementTest extends \PHPUnit\Framework\TestCase */ public function testInvalidEnergyPowerTo() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); Measurement::convertEnergy(1.1, EnergyPowerType::JOULS, 'invalid'); } @@ -512,7 +512,7 @@ class MeasurementTest extends \PHPUnit\Framework\TestCase */ public function testInvalidFileSizeFrom() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); Measurement::convertFileSize(1.1, 'invalid', FileSizeType::KILOBYTE); } @@ -524,7 +524,7 @@ class MeasurementTest extends \PHPUnit\Framework\TestCase */ public function testInvalidFileSizeTo() : void { - self::expectException(\InvalidArgumentException::class); + $this->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 866e9d611..bab3a1a67 100644 --- a/tests/Utils/Encoding/Huffman/DictionaryTest.php +++ b/tests/Utils/Encoding/Huffman/DictionaryTest.php @@ -30,7 +30,7 @@ class DictionaryTest extends \PHPUnit\Framework\TestCase */ public function testInvalidGetCharacter() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $dict = new Dictionary(); $dict->get('as'); @@ -43,7 +43,7 @@ class DictionaryTest extends \PHPUnit\Framework\TestCase */ public function testNotExistingGetCharacter() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $dict = new Dictionary(); $dict->get('a'); @@ -56,7 +56,7 @@ class DictionaryTest extends \PHPUnit\Framework\TestCase */ public function testInvalidSetCharacter() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $dict = new Dictionary(); $dict->set('as', 'test'); @@ -69,7 +69,7 @@ class DictionaryTest extends \PHPUnit\Framework\TestCase */ public function testInvalidSetDuplicateCharacter() : void { - self::expectException(\InvalidArgumentException::class); + $this->expectException(\InvalidArgumentException::class); $dict = new Dictionary(); $dict->set('a', '1'); @@ -83,7 +83,7 @@ class DictionaryTest extends \PHPUnit\Framework\TestCase */ public function testInvalidFormattedValue() : void { - self::expectException(\InvalidArgumentException::class); + $this->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 0b2c3be4c..e09e9735b 100644 --- a/tests/Utils/Git/CommitTest.php +++ b/tests/Utils/Git/CommitTest.php @@ -133,7 +133,7 @@ class CommitTest extends \PHPUnit\Framework\TestCase */ public function testDuplicateLineChange() : void { - self::expectException(\Exception::class); + $this->expectException(\Exception::class); $commit = new Commit(); $commit->addChanges(__DIR__ . '/CommitTest.php', 1, 'expectException(\UnexpectedValueException::class); ArrayParser::parseVariable(new class() {}); } diff --git a/tests/Utils/PermutationTest.php b/tests/Utils/PermutationTest.php index 175f00e0d..e383c861c 100644 --- a/tests/Utils/PermutationTest.php +++ b/tests/Utils/PermutationTest.php @@ -80,7 +80,7 @@ class PermutationTest extends \PHPUnit\Framework\TestCase */ public function testWrongPermuteKeyLength() : void { - self::expectException(\OutOfBoundsException::class); + $this->expectException(\OutOfBoundsException::class); Permutation::permutate('abc', [2, 1, 1, 6]); } diff --git a/tests/Views/ViewTest.php b/tests/Views/ViewTest.php index ae72f7c31..33a25a0ec 100644 --- a/tests/Views/ViewTest.php +++ b/tests/Views/ViewTest.php @@ -431,7 +431,7 @@ class ViewTest extends \PHPUnit\Framework\TestCase */ public function testRenderException() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); $view = new View($this->app->l11nManager); $view->setTemplate('something.txt'); @@ -446,7 +446,7 @@ class ViewTest extends \PHPUnit\Framework\TestCase */ public function testSerializeException() : void { - self::expectException(\phpOMS\System\File\PathException::class); + $this->expectException(\phpOMS\System\File\PathException::class); $view = new View($this->app->l11nManager); $view->setTemplate('something.txt'); @@ -461,7 +461,7 @@ class ViewTest extends \PHPUnit\Framework\TestCase */ public function testTextWithoutModuleAndTemplate() : void { - self::expectException(\phpOMS\Module\Exception\InvalidModuleException::class); + $this->expectException(\phpOMS\Module\Exception\InvalidModuleException::class); $view = new View($this->app->l11nManager); $view->getText('InvalidText'); @@ -474,7 +474,7 @@ class ViewTest extends \PHPUnit\Framework\TestCase */ public function testTextFromInvalidTemplatePath() : void { - self::expectException(\phpOMS\Module\Exception\InvalidModuleException::class); + $this->expectException(\phpOMS\Module\Exception\InvalidModuleException::class); $view = new View($this->app->l11nManager); $view->setTemplate('/Modules/ABC'); @@ -488,7 +488,7 @@ class ViewTest extends \PHPUnit\Framework\TestCase */ public function testTextInvalidTemplate() : void { - self::expectException(\phpOMS\Module\Exception\InvalidThemeException::class); + $this->expectException(\phpOMS\Module\Exception\InvalidThemeException::class); $view = new View($this->app->l11nManager); $view->getText('InvalidText', 'Admin');