mirror of
https://github.com/Karaka-Management/oms-Draw.git
synced 2026-01-11 14:28:40 +00:00
upgrade phpunit
This commit is contained in:
parent
10c7768e1b
commit
1725c0fd8b
|
|
@ -33,10 +33,10 @@ use phpOMS\Router\WebRouter;
|
||||||
use phpOMS\Utils\TestUtils;
|
use phpOMS\Utils\TestUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @testdox Modules\Draw\tests\Controller\ApiControllerTest: Draw api controller
|
|
||||||
*
|
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
|
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Draw\Controller\ApiController::class)]
|
||||||
|
#[\PHPUnit\Framework\Attributes\TestDox('Modules\Draw\tests\Controller\ApiControllerTest: Draw api controller')]
|
||||||
final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
||||||
{
|
{
|
||||||
protected ApplicationAbstract $app;
|
protected ApplicationAbstract $app;
|
||||||
|
|
@ -91,10 +91,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\Draw\Controller\ApiController
|
|
||||||
* @group module
|
|
||||||
*/
|
|
||||||
public function testCreateDraw() : void
|
public function testCreateDraw() : void
|
||||||
{
|
{
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
|
|
@ -110,10 +107,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
||||||
self::assertGreaterThan(0, $response->getDataArray('')['response']->id);
|
self::assertGreaterThan(0, $response->getDataArray('')['response']->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||||
* @covers \Modules\Draw\Controller\ApiController
|
|
||||||
* @group module
|
|
||||||
*/
|
|
||||||
public function testApiDrawCreateInvalidData() : void
|
public function testApiDrawCreateInvalidData() : void
|
||||||
{
|
{
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ use Modules\Media\Models\Media;
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
|
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Draw\Models\DrawImage::class)]
|
||||||
final class DrawImageTest extends \PHPUnit\Framework\TestCase
|
final class DrawImageTest extends \PHPUnit\Framework\TestCase
|
||||||
{
|
{
|
||||||
private DrawImage $img;
|
private DrawImage $img;
|
||||||
|
|
@ -32,30 +33,21 @@ final class DrawImageTest extends \PHPUnit\Framework\TestCase
|
||||||
$this->img = new DrawImage();
|
$this->img = new DrawImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||||
* @covers \Modules\Draw\Models\DrawImage
|
|
||||||
* @group module
|
|
||||||
*/
|
|
||||||
public function testDefault() : void
|
public function testDefault() : void
|
||||||
{
|
{
|
||||||
self::assertEquals(0, $this->img->id);
|
self::assertEquals(0, $this->img->id);
|
||||||
self::assertNull($this->img->media);
|
self::assertNull($this->img->media);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||||
* @covers \Modules\Draw\Models\DrawImage
|
|
||||||
* @group module
|
|
||||||
*/
|
|
||||||
public function testFromMedia() : void
|
public function testFromMedia() : void
|
||||||
{
|
{
|
||||||
$img = DrawImage::fromMedia($temp = new Media());
|
$img = DrawImage::fromMedia($temp = new Media());
|
||||||
self::assertEquals($temp, $img->media);
|
self::assertEquals($temp, $img->media);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||||
* @covers \Modules\Draw\Models\DrawImage
|
|
||||||
* @group module
|
|
||||||
*/
|
|
||||||
public function testSerialize() : void
|
public function testSerialize() : void
|
||||||
{
|
{
|
||||||
self::assertEquals(
|
self::assertEquals(
|
||||||
|
|
|
||||||
|
|
@ -19,31 +19,23 @@ use Modules\Draw\Models\NullDrawImage;
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
|
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Draw\Models\NullDrawImage::class)]
|
||||||
final class NullDrawImageTest extends \PHPUnit\Framework\TestCase
|
final class NullDrawImageTest extends \PHPUnit\Framework\TestCase
|
||||||
{
|
{
|
||||||
/**
|
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||||
* @covers \Modules\Draw\Models\NullDrawImage
|
|
||||||
* @group module
|
|
||||||
*/
|
|
||||||
public function testNull() : void
|
public function testNull() : void
|
||||||
{
|
{
|
||||||
self::assertInstanceOf('\Modules\Draw\Models\DrawImage', new NullDrawImage());
|
self::assertInstanceOf('\Modules\Draw\Models\DrawImage', new NullDrawImage());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||||
* @covers \Modules\Draw\Models\NullDrawImage
|
|
||||||
* @group module
|
|
||||||
*/
|
|
||||||
public function testId() : void
|
public function testId() : void
|
||||||
{
|
{
|
||||||
$null = new NullDrawImage(2);
|
$null = new NullDrawImage(2);
|
||||||
self::assertEquals(2, $null->id);
|
self::assertEquals(2, $null->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||||
* @covers \Modules\Draw\Models\NullDrawImage
|
|
||||||
* @group module
|
|
||||||
*/
|
|
||||||
public function testJsonSerialize() : void
|
public function testJsonSerialize() : void
|
||||||
{
|
{
|
||||||
$null = new NullDrawImage(2);
|
$null = new NullDrawImage(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