mirror of
https://github.com/Karaka-Management/oms-Exchange.git
synced 2026-02-17 02:08:40 +00:00
upgrade phpunit
This commit is contained in:
parent
44379b3b22
commit
4364324a73
|
|
@ -34,10 +34,10 @@ use phpOMS\System\File\Local\Directory;
|
||||||
use phpOMS\Utils\TestUtils;
|
use phpOMS\Utils\TestUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @testdox Modules\Exchange\tests\Controller\ApiControllerTest: Exchange api controller
|
|
||||||
*
|
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
|
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Exchange\Controller\ApiController::class)]
|
||||||
|
#[\PHPUnit\Framework\Attributes\TestDox('Modules\Exchange\tests\Controller\ApiControllerTest: Exchange api controller')]
|
||||||
final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
||||||
{
|
{
|
||||||
protected ApplicationAbstract $app;
|
protected ApplicationAbstract $app;
|
||||||
|
|
@ -92,10 +92,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
||||||
TestUtils::setMember($this->module, 'app', $this->app);
|
TestUtils::setMember($this->module, 'app', $this->app);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||||
* @covers \Modules\Exchange\Controller\ApiController
|
|
||||||
* @group module
|
|
||||||
*/
|
|
||||||
public function testInterfaceInstall() : void
|
public function testInterfaceInstall() : void
|
||||||
{
|
{
|
||||||
$exchanges = \scandir(__DIR__ . '/../Interfaces');
|
$exchanges = \scandir(__DIR__ . '/../Interfaces');
|
||||||
|
|
@ -176,10 +173,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||||
* @covers \Modules\Exchange\Controller\ApiController
|
|
||||||
* @group module
|
|
||||||
*/
|
|
||||||
public function testInterfaceInstallInvalidData() : void
|
public function testInterfaceInstallInvalidData() : void
|
||||||
{
|
{
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
|
|
@ -192,10 +186,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
||||||
self::assertEquals(RequestStatusCode::R_400, $response->header->status);
|
self::assertEquals(RequestStatusCode::R_400, $response->header->status);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||||
* @covers \Modules\Exchange\Controller\ApiController
|
|
||||||
* @group module
|
|
||||||
*/
|
|
||||||
public function testExport() : void
|
public function testExport() : void
|
||||||
{
|
{
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
|
|
@ -209,10 +200,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
||||||
self::assertTrue(\strlen($response->getData('')) > 500);
|
self::assertTrue(\strlen($response->getData('')) > 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||||
* @covers \Modules\Exchange\Controller\ApiController
|
|
||||||
* @group module
|
|
||||||
*/
|
|
||||||
public function testExportInvalidInterface() : void
|
public function testExportInvalidInterface() : void
|
||||||
{
|
{
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
|
|
@ -226,10 +214,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
||||||
self::assertEquals(RequestStatusCode::R_400, $response->header->status);
|
self::assertEquals(RequestStatusCode::R_400, $response->header->status);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||||
* @covers \Modules\Exchange\Controller\ApiController
|
|
||||||
* @group module
|
|
||||||
*/
|
|
||||||
public function testLanguageImport() : void
|
public function testLanguageImport() : void
|
||||||
{
|
{
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
|
|
@ -260,10 +245,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||||
* @covers \Modules\Exchange\Controller\ApiController
|
|
||||||
* @group module
|
|
||||||
*/
|
|
||||||
public function testImportInvalidInterface() : void
|
public function testImportInvalidInterface() : void
|
||||||
{
|
{
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ use Modules\Exchange\Models\ExchangeType;
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
|
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Exchange\Models\ExchangeLog::class)]
|
||||||
final class ExchangeLogTest extends \PHPUnit\Framework\TestCase
|
final class ExchangeLogTest extends \PHPUnit\Framework\TestCase
|
||||||
{
|
{
|
||||||
private ExchangeLog $log;
|
private ExchangeLog $log;
|
||||||
|
|
@ -32,10 +33,7 @@ final class ExchangeLogTest extends \PHPUnit\Framework\TestCase
|
||||||
$this->log = new ExchangeLog();
|
$this->log = new ExchangeLog();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||||
* @covers \Modules\Exchange\Models\ExchangeLog
|
|
||||||
* @group module
|
|
||||||
*/
|
|
||||||
public function testDefault() : void
|
public function testDefault() : void
|
||||||
{
|
{
|
||||||
self::assertEquals(0, $this->log->id);
|
self::assertEquals(0, $this->log->id);
|
||||||
|
|
@ -47,10 +45,7 @@ final class ExchangeLogTest extends \PHPUnit\Framework\TestCase
|
||||||
self::assertInstanceOf('\DateTimeImmutable', $this->log->createdAt);
|
self::assertInstanceOf('\DateTimeImmutable', $this->log->createdAt);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||||
* @covers \Modules\Exchange\Models\ExchangeLog
|
|
||||||
* @group module
|
|
||||||
*/
|
|
||||||
public function testFieldsInputOutput() : void
|
public function testFieldsInputOutput() : void
|
||||||
{
|
{
|
||||||
$this->log->setFields($fields = [
|
$this->log->setFields($fields = [
|
||||||
|
|
@ -60,10 +55,7 @@ final class ExchangeLogTest extends \PHPUnit\Framework\TestCase
|
||||||
self::assertEquals($fields, $this->log->getFields());
|
self::assertEquals($fields, $this->log->getFields());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||||
* @covers \Modules\Exchange\Models\ExchangeLog
|
|
||||||
* @group module
|
|
||||||
*/
|
|
||||||
public function testSerialize() : void
|
public function testSerialize() : void
|
||||||
{
|
{
|
||||||
$this->log->message = '123456';
|
$this->log->message = '123456';
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ use Modules\Exchange\Models\InterfaceManager;
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
|
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Exchange\Models\InterfaceManager::class)]
|
||||||
final class InterfaceManagerTest extends \PHPUnit\Framework\TestCase
|
final class InterfaceManagerTest extends \PHPUnit\Framework\TestCase
|
||||||
{
|
{
|
||||||
private InterfaceManager $interface;
|
private InterfaceManager $interface;
|
||||||
|
|
@ -31,10 +32,7 @@ final class InterfaceManagerTest extends \PHPUnit\Framework\TestCase
|
||||||
$this->interface = new InterfaceManager();
|
$this->interface = new InterfaceManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||||
* @covers \Modules\Exchange\Models\InterfaceManager
|
|
||||||
* @group module
|
|
||||||
*/
|
|
||||||
public function testDefault() : void
|
public function testDefault() : void
|
||||||
{
|
{
|
||||||
self::assertEquals(0, $this->interface->id);
|
self::assertEquals(0, $this->interface->id);
|
||||||
|
|
|
||||||
|
|
@ -19,31 +19,23 @@ use Modules\Exchange\Models\NullExchangeLog;
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
|
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Exchange\Models\NullExchangeLog::class)]
|
||||||
final class NullExchangeLogTest extends \PHPUnit\Framework\TestCase
|
final class NullExchangeLogTest extends \PHPUnit\Framework\TestCase
|
||||||
{
|
{
|
||||||
/**
|
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||||
* @covers \Modules\Exchange\Models\NullExchangeLog
|
|
||||||
* @group module
|
|
||||||
*/
|
|
||||||
public function testNull() : void
|
public function testNull() : void
|
||||||
{
|
{
|
||||||
self::assertInstanceOf('\Modules\Exchange\Models\ExchangeLog', new NullExchangeLog());
|
self::assertInstanceOf('\Modules\Exchange\Models\ExchangeLog', new NullExchangeLog());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||||
* @covers \Modules\Exchange\Models\NullExchangeLog
|
|
||||||
* @group module
|
|
||||||
*/
|
|
||||||
public function testId() : void
|
public function testId() : void
|
||||||
{
|
{
|
||||||
$null = new NullExchangeLog(2);
|
$null = new NullExchangeLog(2);
|
||||||
self::assertEquals(2, $null->id);
|
self::assertEquals(2, $null->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||||
* @covers \Modules\Exchange\Models\NullExchangeLog
|
|
||||||
* @group module
|
|
||||||
*/
|
|
||||||
public function testJsonSerialize() : void
|
public function testJsonSerialize() : void
|
||||||
{
|
{
|
||||||
$null = new NullExchangeLog(2);
|
$null = new NullExchangeLog(2);
|
||||||
|
|
|
||||||
|
|
@ -19,31 +19,23 @@ use Modules\Exchange\Models\NullExchangeSetting;
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
|
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Exchange\Models\NullExchangeSetting::class)]
|
||||||
final class NullExchangeSettingTest extends \PHPUnit\Framework\TestCase
|
final class NullExchangeSettingTest extends \PHPUnit\Framework\TestCase
|
||||||
{
|
{
|
||||||
/**
|
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||||
* @covers \Modules\Exchange\Models\NullExchangeSetting
|
|
||||||
* @group module
|
|
||||||
*/
|
|
||||||
public function testNull() : void
|
public function testNull() : void
|
||||||
{
|
{
|
||||||
self::assertInstanceOf('\Modules\Exchange\Models\ExchangeSetting', new NullExchangeSetting());
|
self::assertInstanceOf('\Modules\Exchange\Models\ExchangeSetting', new NullExchangeSetting());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||||
* @covers \Modules\Exchange\Models\NullExchangeSetting
|
|
||||||
* @group module
|
|
||||||
*/
|
|
||||||
public function testId() : void
|
public function testId() : void
|
||||||
{
|
{
|
||||||
$null = new NullExchangeSetting(2);
|
$null = new NullExchangeSetting(2);
|
||||||
self::assertEquals(2, $null->id);
|
self::assertEquals(2, $null->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||||
* @covers \Modules\Exchange\Models\NullExchangeSetting
|
|
||||||
* @group module
|
|
||||||
*/
|
|
||||||
public function testJsonSerialize() : void
|
public function testJsonSerialize() : void
|
||||||
{
|
{
|
||||||
$null = new NullExchangeSetting(2);
|
$null = new NullExchangeSetting(2);
|
||||||
|
|
|
||||||
|
|
@ -19,31 +19,23 @@ use Modules\Exchange\Models\NullInterfaceManager;
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
|
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Exchange\Models\NullInterfaceManager::class)]
|
||||||
final class NullInterfaceManagerTest extends \PHPUnit\Framework\TestCase
|
final class NullInterfaceManagerTest extends \PHPUnit\Framework\TestCase
|
||||||
{
|
{
|
||||||
/**
|
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||||
* @covers \Modules\Exchange\Models\NullInterfaceManager
|
|
||||||
* @group module
|
|
||||||
*/
|
|
||||||
public function testNull() : void
|
public function testNull() : void
|
||||||
{
|
{
|
||||||
self::assertInstanceOf('\Modules\Exchange\Models\InterfaceManager', new NullInterfaceManager());
|
self::assertInstanceOf('\Modules\Exchange\Models\InterfaceManager', new NullInterfaceManager());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||||
* @covers \Modules\Exchange\Models\NullInterfaceManager
|
|
||||||
* @group module
|
|
||||||
*/
|
|
||||||
public function testId() : void
|
public function testId() : void
|
||||||
{
|
{
|
||||||
$null = new NullInterfaceManager(2);
|
$null = new NullInterfaceManager(2);
|
||||||
self::assertEquals(2, $null->id);
|
self::assertEquals(2, $null->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||||
* @covers \Modules\Exchange\Models\NullInterfaceManager
|
|
||||||
* @group module
|
|
||||||
*/
|
|
||||||
public function testJsonSerialize() : void
|
public function testJsonSerialize() : void
|
||||||
{
|
{
|
||||||
$null = new NullInterfaceManager(2);
|
$null = new NullInterfaceManager(2);
|
||||||
|
|
|
||||||
|
|
@ -1,31 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="Bootstrap.php" colors="true" columns="120" stopOnError="true" stopOnFailure="false" stopOnIncomplete="false" stopOnSkipped="false" beStrictAboutTestsThatDoNotTestAnything="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="Bootstrap.php" colors="true" columns="120" stopOnError="true" stopOnFailure="false" stopOnIncomplete="false" stopOnSkipped="false" beStrictAboutTestsThatDoNotTestAnything="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.0/phpunit.xsd" cacheDirectory=".phpunit.cache">
|
||||||
<coverage includeUncoveredFiles="true" processUncoveredFiles="false">
|
<coverage includeUncoveredFiles="true">
|
||||||
<include>
|
|
||||||
<directory suffix=".php">../</directory>
|
|
||||||
</include>
|
|
||||||
<exclude>
|
|
||||||
<directory>../vendor*</directory>
|
|
||||||
<directory>../MainRepository*</directory>
|
|
||||||
<directory>../Karaka*</directory>
|
|
||||||
<directory>../Admin/Install/Application*</directory>
|
|
||||||
<directory>../phpOMS*</directory>
|
|
||||||
<directory>../tests*</directory>
|
|
||||||
<directory>../*/tests*</directory>
|
|
||||||
<directory>../**/tests*</directory>
|
|
||||||
<directory>*/tests*</directory>
|
|
||||||
<directory suffix="tpl.php">../*</directory>
|
|
||||||
<directory suffix="lang.php">../*</directory>
|
|
||||||
<directory suffix="Test.php">../*</directory>
|
|
||||||
<directory suffix="Routes.php">../*</directory>
|
|
||||||
<directory suffix="Hooks.php">../*</directory>
|
|
||||||
<directory>../**/test*</directory>
|
|
||||||
<directory>../**/Theme*</directory>
|
|
||||||
<directory>../**/Admin/Routes*</directory>
|
|
||||||
<directory>../**/Admin/Hooks*</directory>
|
|
||||||
<directory>../**/Admin/Install*</directory>
|
|
||||||
<directory>../Media/Files*</directory>
|
|
||||||
</exclude>
|
|
||||||
<report>
|
<report>
|
||||||
<clover outputFile="coverage.xml"/>
|
<clover outputFile="coverage.xml"/>
|
||||||
<html outputDirectory="../tests" lowUpperBound="75" highLowerBound="95"/>
|
<html outputDirectory="../tests" lowUpperBound="75" highLowerBound="95"/>
|
||||||
|
|
@ -56,4 +31,31 @@
|
||||||
<const name="WEB_SERVER_DOCROOT" value="./Karaka"/>
|
<const name="WEB_SERVER_DOCROOT" value="./Karaka"/>
|
||||||
<const name="RESET" value="1"/>
|
<const name="RESET" value="1"/>
|
||||||
</php>
|
</php>
|
||||||
|
<source>
|
||||||
|
<include>
|
||||||
|
<directory suffix=".php">../</directory>
|
||||||
|
</include>
|
||||||
|
<exclude>
|
||||||
|
<directory>../vendor*</directory>
|
||||||
|
<directory>../MainRepository*</directory>
|
||||||
|
<directory>../Karaka*</directory>
|
||||||
|
<directory>../Admin/Install/Application*</directory>
|
||||||
|
<directory>../phpOMS*</directory>
|
||||||
|
<directory>../tests*</directory>
|
||||||
|
<directory>../*/tests*</directory>
|
||||||
|
<directory>../**/tests*</directory>
|
||||||
|
<directory>*/tests*</directory>
|
||||||
|
<directory suffix="tpl.php">../*</directory>
|
||||||
|
<directory suffix="lang.php">../*</directory>
|
||||||
|
<directory suffix="Test.php">../*</directory>
|
||||||
|
<directory suffix="Routes.php">../*</directory>
|
||||||
|
<directory suffix="Hooks.php">../*</directory>
|
||||||
|
<directory>../**/test*</directory>
|
||||||
|
<directory>../**/Theme*</directory>
|
||||||
|
<directory>../**/Admin/Routes*</directory>
|
||||||
|
<directory>../**/Admin/Hooks*</directory>
|
||||||
|
<directory>../**/Admin/Install*</directory>
|
||||||
|
<directory>../Media/Files*</directory>
|
||||||
|
</exclude>
|
||||||
|
</source>
|
||||||
</phpunit>
|
</phpunit>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user