mirror of
https://github.com/Karaka-Management/oms-SupplierManagement.git
synced 2026-01-10 17:08:41 +00:00
upgrade phpunit
This commit is contained in:
parent
611b82e6f2
commit
226154b4b5
|
|
@ -24,8 +24,8 @@ trait ApiControllerAttributeTrait
|
|||
{
|
||||
/**
|
||||
* @covers \Modules\SupplierManagement\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiSupplierAttributeTypeCreate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
@ -42,8 +42,8 @@ trait ApiControllerAttributeTrait
|
|||
|
||||
/**
|
||||
* @covers \Modules\SupplierManagement\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiSupplierAttributeTypeL11nCreate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
@ -60,8 +60,8 @@ trait ApiControllerAttributeTrait
|
|||
|
||||
/**
|
||||
* @covers \Modules\SupplierManagement\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiSupplierAttributeValueIntCreate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
@ -80,8 +80,8 @@ trait ApiControllerAttributeTrait
|
|||
|
||||
/**
|
||||
* @covers \Modules\SupplierManagement\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiSupplierAttributeValueStrCreate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
@ -99,8 +99,8 @@ trait ApiControllerAttributeTrait
|
|||
|
||||
/**
|
||||
* @covers \Modules\SupplierManagement\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiSupplierAttributeValueFloatCreate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
@ -118,8 +118,8 @@ trait ApiControllerAttributeTrait
|
|||
|
||||
/**
|
||||
* @covers \Modules\SupplierManagement\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiSupplierAttributeValueDatCreate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
@ -137,8 +137,8 @@ trait ApiControllerAttributeTrait
|
|||
|
||||
/**
|
||||
* @covers \Modules\SupplierManagement\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiSupplierAttributeCreate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
@ -155,8 +155,8 @@ trait ApiControllerAttributeTrait
|
|||
|
||||
/**
|
||||
* @covers \Modules\SupplierManagement\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiSupplierAttributeValueCreateInvalidData() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
@ -171,8 +171,8 @@ trait ApiControllerAttributeTrait
|
|||
|
||||
/**
|
||||
* @covers \Modules\SupplierManagement\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiSupplierAttributeTypeCreateInvalidData() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
@ -187,8 +187,8 @@ trait ApiControllerAttributeTrait
|
|||
|
||||
/**
|
||||
* @covers \Modules\SupplierManagement\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiSupplierAttributeTypeL11nCreateInvalidData() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
@ -203,8 +203,8 @@ trait ApiControllerAttributeTrait
|
|||
|
||||
/**
|
||||
* @covers \Modules\SupplierManagement\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiSupplierAttributeCreateInvalidData() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ trait ApiControllerSupplierTrait
|
|||
|
||||
/**
|
||||
* @covers \Modules\SupplierManagement\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiSupplierCreate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
@ -59,8 +59,8 @@ trait ApiControllerSupplierTrait
|
|||
|
||||
/**
|
||||
* @covers \Modules\SupplierManagement\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiSupplierCreateInvalidData() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
@ -75,8 +75,8 @@ trait ApiControllerSupplierTrait
|
|||
|
||||
/**
|
||||
* @covers \Modules\SupplierManagement\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiSupplierProfileImageCreate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
@ -106,8 +106,8 @@ trait ApiControllerSupplierTrait
|
|||
|
||||
/**
|
||||
* @covers \Modules\SupplierManagement\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiSupplierFileCreate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
@ -136,8 +136,8 @@ trait ApiControllerSupplierTrait
|
|||
|
||||
/**
|
||||
* @covers \Modules\SupplierManagement\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiSupplierNoteCreate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
@ -157,8 +157,8 @@ trait ApiControllerSupplierTrait
|
|||
|
||||
/**
|
||||
* @covers \Modules\SupplierManagement\Controller\ApiController
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testApiFileCreateInvalidData() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
|
|
|
|||
|
|
@ -32,10 +32,9 @@ use phpOMS\Router\WebRouter;
|
|||
use phpOMS\Utils\TestUtils;
|
||||
|
||||
/**
|
||||
* @testdox Modules\SupplierManagement\tests\Controller\ApiControllerTest: SupplierManagement api controller
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\TestDox('Modules\SupplierManagement\tests\Controller\ApiControllerTest: SupplierManagement api controller')]
|
||||
final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
protected ApplicationAbstract $app;
|
||||
|
|
|
|||
|
|
@ -19,31 +19,23 @@ use Modules\SupplierManagement\Models\NullSupplier;
|
|||
/**
|
||||
* @internal
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\SupplierManagement\Models\NullSupplier::class)]
|
||||
final class NullSupplierTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @covers \Modules\SupplierManagement\Models\NullSupplier
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testNull() : void
|
||||
{
|
||||
self::assertInstanceOf('\Modules\SupplierManagement\Models\Supplier', new NullSupplier());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\SupplierManagement\Models\NullSupplier
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testId() : void
|
||||
{
|
||||
$null = new NullSupplier(2);
|
||||
self::assertEquals(2, $null->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\SupplierManagement\Models\NullSupplier
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testJsonSerialize() : void
|
||||
{
|
||||
$null = new NullSupplier(2);
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ use Modules\SupplierManagement\Models\SupplierStatus;
|
|||
/**
|
||||
* @internal
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\SupplierManagement\Models\Supplier::class)]
|
||||
final class SupplierTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
private Supplier $supplier;
|
||||
|
|
@ -34,10 +35,7 @@ final class SupplierTest extends \PHPUnit\Framework\TestCase
|
|||
$this->supplier = new Supplier();
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\SupplierManagement\Models\Supplier
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testDefault() : void
|
||||
{
|
||||
self::assertEquals(0, $this->supplier->id);
|
||||
|
|
@ -55,10 +53,7 @@ final class SupplierTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertInstanceOf('\phpOMS\Stdlib\Base\Address', $this->supplier->mainAddress);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\SupplierManagement\Models\Supplier
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testContactElementInputOutput() : void
|
||||
{
|
||||
$this->supplier->addContactElement($temp = new ContactElement());
|
||||
|
|
@ -66,20 +61,14 @@ final class SupplierTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals($temp, $this->supplier->getMainContactElement(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\SupplierManagement\Models\Supplier
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testNoteInputOutput() : void
|
||||
{
|
||||
$this->supplier->addNote(new EditorDoc());
|
||||
self::assertCount(1, $this->supplier->getNotes());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\SupplierManagement\Models\Supplier
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testSerialize() : void
|
||||
{
|
||||
$this->supplier->number = '123456';
|
||||
|
|
|
|||
|
|
@ -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