mirror of
https://github.com/Karaka-Management/oms-Support.git
synced 2026-01-10 16:48:41 +00:00
upgrade phpunit
This commit is contained in:
parent
65ee96550c
commit
374d34901c
|
|
@ -23,8 +23,8 @@ trait ApiControllerTicketTrait
|
|||
{
|
||||
/**
|
||||
* @covers \Modules\Support\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiSupportAppCreate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
@ -39,8 +39,8 @@ trait ApiControllerTicketTrait
|
|||
|
||||
/**
|
||||
* @covers \Modules\Support\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiSupportAppCreateInvalidData() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
@ -55,8 +55,8 @@ trait ApiControllerTicketTrait
|
|||
|
||||
/**
|
||||
* @covers \Modules\Support\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiTicketCreate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
@ -74,8 +74,8 @@ trait ApiControllerTicketTrait
|
|||
|
||||
/**
|
||||
* @covers \Modules\Support\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiTicketGet() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
@ -90,8 +90,8 @@ trait ApiControllerTicketTrait
|
|||
|
||||
/**
|
||||
* @covers \Modules\Support\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiTicketCreateInvalidData() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
@ -106,8 +106,8 @@ trait ApiControllerTicketTrait
|
|||
|
||||
/**
|
||||
* @covers \Modules\Support\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiTicketElementCreate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
@ -125,8 +125,8 @@ trait ApiControllerTicketTrait
|
|||
|
||||
/**
|
||||
* @covers \Modules\Support\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiTicketElementGet() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
@ -141,8 +141,8 @@ trait ApiControllerTicketTrait
|
|||
|
||||
/**
|
||||
* @covers \Modules\Support\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiTicketElementCreateInvalidData() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
|
|||
|
|
@ -31,10 +31,9 @@ use phpOMS\Router\WebRouter;
|
|||
use phpOMS\Utils\TestUtils;
|
||||
|
||||
/**
|
||||
* @testdox Modules\Support\tests\Controller\ApiControllerTest: Support api controller
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\TestDox('Modules\Support\tests\Controller\ApiControllerTest: Support api controller')]
|
||||
final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
protected ApplicationAbstract $app;
|
||||
|
|
|
|||
|
|
@ -19,31 +19,23 @@ use Modules\Support\Models\NullSupportApp;
|
|||
/**
|
||||
* @internal
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Support\Models\NullSupportApp::class)]
|
||||
final class NullSupportAppTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @covers \Modules\Support\Models\NullSupportApp
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testNull() : void
|
||||
{
|
||||
self::assertInstanceOf('\Modules\Support\Models\SupportApp', new NullSupportApp());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\Support\Models\NullSupportApp
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testId() : void
|
||||
{
|
||||
$null = new NullSupportApp(2);
|
||||
self::assertEquals(2, $null->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\Support\Models\NullSupportApp
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testJsonSerialize() : void
|
||||
{
|
||||
$null = new NullSupportApp(2);
|
||||
|
|
|
|||
|
|
@ -19,31 +19,23 @@ use Modules\Support\Models\NullTicketElement;
|
|||
/**
|
||||
* @internal
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Support\Models\NullTicketElement::class)]
|
||||
final class NullTicketElementTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @covers \Modules\Support\Models\NullTicketElement
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testNull() : void
|
||||
{
|
||||
self::assertInstanceOf('\Modules\Support\Models\TicketElement', new NullTicketElement());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\Support\Models\NullTicketElement
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testId() : void
|
||||
{
|
||||
$null = new NullTicketElement(2);
|
||||
self::assertEquals(2, $null->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\Support\Models\NullTicketElement
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testJsonSerialize() : void
|
||||
{
|
||||
$null = new NullTicketElement(2);
|
||||
|
|
|
|||
|
|
@ -19,31 +19,23 @@ use Modules\Support\Models\NullTicket;
|
|||
/**
|
||||
* @internal
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Support\Models\NullTicket::class)]
|
||||
final class NullTicketTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @covers \Modules\Support\Models\NullTicket
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testNull() : void
|
||||
{
|
||||
self::assertInstanceOf('\Modules\Support\Models\Ticket', new NullTicket());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\Support\Models\NullTicket
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testId() : void
|
||||
{
|
||||
$null = new NullTicket(2);
|
||||
self::assertEquals(2, $null->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\Support\Models\NullTicket
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testJsonSerialize() : void
|
||||
{
|
||||
$null = new NullTicket(2);
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ use Modules\Support\Models\SupportApp;
|
|||
/**
|
||||
* @internal
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Support\Models\SupportApp::class)]
|
||||
final class SupportAppTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
private SupportApp $app;
|
||||
|
|
@ -31,20 +32,14 @@ final class SupportAppTest extends \PHPUnit\Framework\TestCase
|
|||
$this->app = new SupportApp();
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\Support\Models\SupportApp
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testDefault() : void
|
||||
{
|
||||
self::assertEquals(0, $this->app->id);
|
||||
self::assertEquals('', $this->app->name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\Support\Models\SupportApp
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testSerialize() : void
|
||||
{
|
||||
$this->app->name = 'Test Title';
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ use Modules\Support\Models\TicketElement;
|
|||
/**
|
||||
* @internal
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Support\Models\TicketElement::class)]
|
||||
final class TicketElementTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
private TicketElement $element;
|
||||
|
|
@ -31,20 +32,14 @@ final class TicketElementTest extends \PHPUnit\Framework\TestCase
|
|||
$this->element = new TicketElement();
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\Support\Models\TicketElement
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testDefault() : void
|
||||
{
|
||||
self::assertEquals(0, $this->element->id);
|
||||
self::assertEquals(0, $this->element->ticket);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\Support\Models\TicketElement
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testSerialize() : void
|
||||
{
|
||||
$this->element->ticket = 2;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ use Modules\Support\Models\TicketElement;
|
|||
/**
|
||||
* @internal
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Support\Models\Ticket::class)]
|
||||
final class TicketTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
private Ticket $ticket;
|
||||
|
|
@ -32,10 +33,7 @@ final class TicketTest extends \PHPUnit\Framework\TestCase
|
|||
$this->ticket = new Ticket();
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\Support\Models\Ticket
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testDefault() : void
|
||||
{
|
||||
self::assertEquals(0, $this->ticket->id);
|
||||
|
|
@ -46,10 +44,7 @@ final class TicketTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertInstanceOf('\Modules\Support\Models\SupportApp', $this->ticket->app);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\Support\Models\Ticket
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testElementInputOutput() : void
|
||||
{
|
||||
$element1 = new TicketElement();
|
||||
|
|
@ -62,10 +57,7 @@ final class TicketTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals([$element2, $element1], $this->ticket->invertTicketElements());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\Support\Models\Ticket
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testElementRemove() : void
|
||||
{
|
||||
$element1 = new TicketElement();
|
||||
|
|
@ -77,10 +69,7 @@ final class TicketTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertFalse($this->ticket->removeElement(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\Support\Models\Ticket
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testSerialize() : void
|
||||
{
|
||||
$serialized = $this->ticket->jsonSerialize();
|
||||
|
|
|
|||
|
|
@ -24,12 +24,10 @@ use Modules\Support\Views\TicketView;
|
|||
/**
|
||||
* @internal
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Support\Views\TicketView::class)]
|
||||
class TicketViewTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @covers \Modules\Support\Views\TicketView
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testDefault() : void
|
||||
{
|
||||
$view = new TicketView();
|
||||
|
|
@ -37,10 +35,7 @@ class TicketViewTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertStringContainsString('', $view->getAccountImage(999));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\Support\Views\TicketView
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testAccountImageUrl() : void
|
||||
{
|
||||
$media = new Media();
|
||||
|
|
|
|||
|
|
@ -1,31 +1,6 @@
|
|||
<?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">
|
||||
<coverage includeUncoveredFiles="true" processUncoveredFiles="false">
|
||||
<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>
|
||||
<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">
|
||||
<report>
|
||||
<clover outputFile="coverage.xml"/>
|
||||
<html outputDirectory="../tests" lowUpperBound="75" highLowerBound="95"/>
|
||||
|
|
@ -56,4 +31,31 @@
|
|||
<const name="WEB_SERVER_DOCROOT" value="./Karaka"/>
|
||||
<const name="RESET" value="1"/>
|
||||
</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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user