mirror of
https://github.com/Karaka-Management/oms-Tag.git
synced 2026-01-10 15:28:39 +00:00
upgrade phpunit
This commit is contained in:
parent
363d023620
commit
1fefab5579
|
|
@ -34,6 +34,7 @@ use phpOMS\Utils\TestUtils;
|
|||
/**
|
||||
* @internal
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Tag\Controller\ApiController::class)]
|
||||
final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
protected $app = null;
|
||||
|
|
@ -92,10 +93,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
|||
**/
|
||||
private static int $tagId = 0;
|
||||
|
||||
/**
|
||||
* @covers \Modules\Tag\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiTagCreate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
@ -114,10 +112,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
|||
self::$tagId = $response->getDataArray('')['response']->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\Tag\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiTagCreateInvalid() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
@ -128,10 +123,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(RequestStatusCode::R_400, $response->header->status);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\Tag\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiTagL11nCreate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
@ -148,10 +140,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertGreaterThan(0, $response->getDataArray('')['response']->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\Tag\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiTagL11nCreateInvalid() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
@ -162,10 +151,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(RequestStatusCode::R_400, $response->header->status);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\Tag\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiTagGet() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
@ -179,10 +165,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(self::$tagId, $response->getDataArray('')['response']->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\Tag\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiTagUpdate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
@ -198,10 +181,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(self::$tagId, $response->getDataArray('')['response']->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\Tag\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiUnitFind() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
|
|||
|
|
@ -19,31 +19,23 @@ use Modules\Tag\Models\NullTag;
|
|||
/**
|
||||
* @internal
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Tag\Models\NullTag::class)]
|
||||
final class NullTagTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @covers \Modules\Tag\Models\NullTag
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testNull() : void
|
||||
{
|
||||
self::assertInstanceOf('\Modules\Tag\Models\Tag', new NullTag());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\Tag\Models\NullTag
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testId() : void
|
||||
{
|
||||
$null = new NullTag(2);
|
||||
self::assertEquals(2, $null->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\Tag\Models\NullTag
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testJsonSerialize() : void
|
||||
{
|
||||
$null = new NullTag(2);
|
||||
|
|
|
|||
|
|
@ -24,12 +24,10 @@ use phpOMS\Localization\ISO639x1Enum;
|
|||
/**
|
||||
* @internal
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Tag\Models\TagL11nMapper::class)]
|
||||
final class TagL11nMapperTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @covers \Modules\Tag\Models\TagL11nMapper
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testCR() : void
|
||||
{
|
||||
$tag = new Tag();
|
||||
|
|
|
|||
|
|
@ -22,12 +22,10 @@ use phpOMS\Localization\ISO639x1Enum;
|
|||
/**
|
||||
* @internal
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Tag\Models\TagMapper::class)]
|
||||
final class TagMapperTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @covers \Modules\Tag\Models\TagMapper
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testCR() : void
|
||||
{
|
||||
$tag = new Tag();
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ use phpOMS\Localization\BaseStringL11n;
|
|||
/**
|
||||
* @internal
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Tag\Models\Tag::class)]
|
||||
final class TagTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
private Tag $tag;
|
||||
|
|
@ -34,10 +35,7 @@ final class TagTest extends \PHPUnit\Framework\TestCase
|
|||
$this->tag = new Tag();
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\Tag\Models\Tag
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testDefault() : void
|
||||
{
|
||||
self::assertEquals(0, $this->tag->id);
|
||||
|
|
@ -47,10 +45,7 @@ final class TagTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals('', $this->tag->getL11n());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\Tag\Models\Tag
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testTitleInputOutput() : void
|
||||
{
|
||||
$this->tag->setL11n('Test');
|
||||
|
|
@ -63,30 +58,21 @@ final class TagTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals('Test3', $this->tag->getL11n());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\Tag\Models\Tag
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testOwnerInputOutput() : void
|
||||
{
|
||||
$this->tag->owner = new NullAccount(2);
|
||||
self::assertEquals(2, $this->tag->owner->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\Tag\Models\Tag
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testColorInputOutput() : void
|
||||
{
|
||||
$this->tag->color = 'ffffffff';
|
||||
self::assertEquals('ffffffff', $this->tag->color);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\Tag\Models\Tag
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testSerialize() : void
|
||||
{
|
||||
$this->tag->setL11n($t = new BaseStringL11n('Test'));
|
||||
|
|
|
|||
|
|
@ -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