mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 09:48:40 +00:00
fix tests
This commit is contained in:
parent
3801c29cf6
commit
50743fecf0
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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']);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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']);
|
||||
|
|
|
|||
|
|
@ -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']);
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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']);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ class L11nManagerTest extends \PHPUnit\Framework\TestCase
|
|||
*/
|
||||
public function testInvalidModule() : void
|
||||
{
|
||||
self::expectException(\Exception::class);
|
||||
$this->expectException(\Exception::class);
|
||||
|
||||
$expected = [
|
||||
'en' => [
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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, [
|
||||
|
|
|
|||
|
|
@ -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([
|
||||
|
|
|
|||
|
|
@ -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([
|
||||
|
|
|
|||
|
|
@ -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]]);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -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([]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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__);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -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, '<?php', 'test');
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ class ArrayParserTest extends \PHPUnit\Framework\TestCase
|
|||
*/
|
||||
public function testInvalidValueType() : void
|
||||
{
|
||||
self::expectException(\UnexpectedValueException::class);
|
||||
$this->expectException(\UnexpectedValueException::class);
|
||||
|
||||
ArrayParser::parseVariable(new class() {});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user