From 7520fdfde7849ce2c013e0320c9529f5d00dc53d Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 20 Mar 2024 05:15:59 +0000 Subject: [PATCH] upgrade phpunit --- .../Controller/Api/ApiBillControllerTrait.php | 4 +- tests/Controller/ApiControllerTest.php | 3 +- tests/Models/BillElementTest.php | 16 +--- tests/Models/BillTest.php | 16 +--- tests/Models/BillTypeTest.php | 11 +-- tests/Models/InvoiceRecognitionTest.php | 80 +++++++------------ tests/Models/NullBillElementTest.php | 16 +--- tests/Models/NullBillTest.php | 16 +--- tests/Models/NullBillTypeTest.php | 16 +--- tests/Models/NullSubscriptionTest.php | 16 +--- tests/Models/Price/NullPriceTest.php | 16 +--- tests/Models/PurchaseBillMapperTest.php | 69 ++++------------ tests/Models/SalesBillMapperTest.php | 74 ++++------------- tests/Models/StockBillMapperTest.php | 14 +--- tests/Models/Tax/NullTaxCombinationTest.php | 16 +--- tests/phpunit_default.xml | 56 ++++++------- 16 files changed, 129 insertions(+), 310 deletions(-) diff --git a/tests/Controller/Api/ApiBillControllerTrait.php b/tests/Controller/Api/ApiBillControllerTrait.php index 2c33e8b..1670cbf 100644 --- a/tests/Controller/Api/ApiBillControllerTrait.php +++ b/tests/Controller/Api/ApiBillControllerTrait.php @@ -101,8 +101,8 @@ trait ApiBillControllerTrait /** * @covers \Modules\Billing\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testBillCreateInvalidData() : void { $response = new HttpResponse(); @@ -117,8 +117,8 @@ trait ApiBillControllerTrait /** * @covers \Modules\Billing\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testBillElementCreateInvalidData() : void { $response = new HttpResponse(); diff --git a/tests/Controller/ApiControllerTest.php b/tests/Controller/ApiControllerTest.php index 710f6de..cb71db9 100755 --- a/tests/Controller/ApiControllerTest.php +++ b/tests/Controller/ApiControllerTest.php @@ -31,10 +31,9 @@ use phpOMS\Router\WebRouter; use phpOMS\Utils\TestUtils; /** - * @testdox Modules\tests\Billing\Controller\ApiControllerTest: Billing api controller - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('Modules\tests\Billing\Controller\ApiControllerTest: Billing api controller')] final class ApiControllerTest extends \PHPUnit\Framework\TestCase { protected ApplicationAbstract $app; diff --git a/tests/Models/BillElementTest.php b/tests/Models/BillElementTest.php index 96fac05..063025f 100755 --- a/tests/Models/BillElementTest.php +++ b/tests/Models/BillElementTest.php @@ -22,6 +22,7 @@ use phpOMS\Stdlib\Base\FloatInt; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Billing\Models\BillElement::class)] final class BillElementTest extends \PHPUnit\Framework\TestCase { private BillElement $element; @@ -34,10 +35,7 @@ final class BillElementTest extends \PHPUnit\Framework\TestCase $this->element = new BillElement(); } - /** - * @covers \Modules\Billing\Models\BillElement - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDefault() : void { self::assertEquals(0, $this->element->id); @@ -47,20 +45,14 @@ final class BillElementTest extends \PHPUnit\Framework\TestCase self::assertInstanceOf('\phpOMS\Stdlib\Base\FloatInt', $this->element->totalPurchasePriceNet); } - /** - * @covers \Modules\Billing\Models\BillElement - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testItemInputOutput() : void { $this->element->setItem(123); self::assertEquals(123, $this->element->item->id); } - /** - * @covers \Modules\Billing\Models\BillElement - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testSerialize() : void { $this->element->order = 2; diff --git a/tests/Models/BillTest.php b/tests/Models/BillTest.php index 89f37d5..504ec9e 100755 --- a/tests/Models/BillTest.php +++ b/tests/Models/BillTest.php @@ -20,6 +20,7 @@ use Modules\Billing\Models\NullBillType; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Billing\Models\Bill::class)] final class BillTest extends \PHPUnit\Framework\TestCase { private Bill $bill; @@ -32,10 +33,7 @@ final class BillTest extends \PHPUnit\Framework\TestCase $this->bill = new Bill(); } - /** - * @covers \Modules\Billing\Models\Bill - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDefault() : void { self::assertEquals(0, $this->bill->id); @@ -76,20 +74,14 @@ final class BillTest extends \PHPUnit\Framework\TestCase self::assertEquals('', $this->bill->shippingText); } - /** - * @covers \Modules\Billing\Models\Bill - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNumberRendering() : void { $this->bill->type->numberFormat = '{y}{m}{d}-{id}'; self::assertEquals(\date('Y') . \date('m') . \date('d') . '-0', $this->bill->getNumber()); } - /** - * @covers \Modules\Billing\Models\Bill - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testSerialize() : void { $this->bill->number = '123456'; diff --git a/tests/Models/BillTypeTest.php b/tests/Models/BillTypeTest.php index a9c1625..708904a 100755 --- a/tests/Models/BillTypeTest.php +++ b/tests/Models/BillTypeTest.php @@ -20,6 +20,7 @@ use phpOMS\Localization\BaseStringL11n; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Billing\Models\BillType::class)] final class BillTypeTest extends \PHPUnit\Framework\TestCase { private BillType $type; @@ -32,20 +33,14 @@ final class BillTypeTest extends \PHPUnit\Framework\TestCase $this->type = new BillType(); } - /** - * @covers \Modules\Billing\Models\BillType - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDefault() : void { self::assertEquals(0, $this->type->id); self::assertTrue($this->type->transferStock); } - /** - * @covers \Modules\Billing\Models\BillType - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testL11nInputOutput() : void { $this->type->setL11n('Test1'); diff --git a/tests/Models/InvoiceRecognitionTest.php b/tests/Models/InvoiceRecognitionTest.php index 747f420..1bc79f6 100644 --- a/tests/Models/InvoiceRecognitionTest.php +++ b/tests/Models/InvoiceRecognitionTest.php @@ -26,10 +26,8 @@ require_once __DIR__ . '/../Autoloader.php'; */ final class InvoiceRecognitionTest extends \PHPUnit\Framework\TestCase { - /** - * @dataProvider billList - * @group maybe - */ + #[\PHPUnit\Framework\Attributes\DataProvider('billList')] + #[\PHPUnit\Framework\Attributes\Group('maybe')] public function testNetSales($json, $content) : void { $billObj = new Bill(); @@ -40,10 +38,8 @@ final class InvoiceRecognitionTest extends \PHPUnit\Framework\TestCase self::assertEquals($test['netSales'], $billObj->netSales->value); } - /** - * @dataProvider billList - * @group maybe - */ + #[\PHPUnit\Framework\Attributes\DataProvider('billList')] + #[\PHPUnit\Framework\Attributes\Group('maybe')] public function testTaxRate($json, $content) : void { $billObj = new Bill(); @@ -54,10 +50,8 @@ final class InvoiceRecognitionTest extends \PHPUnit\Framework\TestCase self::assertEquals($test['tax_rate'], \reset($billObj->elements)->taxR->value); } - /** - * @dataProvider billList - * @group maybe - */ + #[\PHPUnit\Framework\Attributes\DataProvider('billList')] + #[\PHPUnit\Framework\Attributes\Group('maybe')] public function testGrossSales($json, $content) : void { $billObj = new Bill(); @@ -68,10 +62,8 @@ final class InvoiceRecognitionTest extends \PHPUnit\Framework\TestCase self::assertEquals($test['grossSales'], $billObj->grossSales->value); } - /** - * @dataProvider billList - * @group maybe - */ + #[\PHPUnit\Framework\Attributes\DataProvider('billList')] + #[\PHPUnit\Framework\Attributes\Group('maybe')] public function testTaxAmount($json, $content) : void { $billObj = new Bill(); @@ -82,10 +74,8 @@ final class InvoiceRecognitionTest extends \PHPUnit\Framework\TestCase self::assertEquals($test['tax_amount'], $billObj->taxP->value); } - /** - * @dataProvider billList - * @group maybe - */ + #[\PHPUnit\Framework\Attributes\DataProvider('billList')] + #[\PHPUnit\Framework\Attributes\Group('maybe')] public function testBillDate($json, $content) : void { $billObj = new Bill(); @@ -96,10 +86,8 @@ final class InvoiceRecognitionTest extends \PHPUnit\Framework\TestCase self::assertEquals($test['bill_date'], $billObj->billDate?->format('Y-m-d')); } - /** - * @dataProvider billList - * @group maybe - */ + #[\PHPUnit\Framework\Attributes\DataProvider('billList')] + #[\PHPUnit\Framework\Attributes\Group('maybe')] public function testBillLanguage($json, $content) : void { $billObj = new Bill(); @@ -110,10 +98,8 @@ final class InvoiceRecognitionTest extends \PHPUnit\Framework\TestCase self::assertEquals($test['language'], $billObj->language); } - /** - * @dataProvider billList - * @group maybe - */ + #[\PHPUnit\Framework\Attributes\DataProvider('billList')] + #[\PHPUnit\Framework\Attributes\Group('maybe')] public function testBillCurrency($json, $content) : void { $billObj = new Bill(); @@ -124,10 +110,8 @@ final class InvoiceRecognitionTest extends \PHPUnit\Framework\TestCase self::assertEquals($test['currency'], $billObj->currency); } - /** - * @dataProvider billList - * @group maybe - */ + #[\PHPUnit\Framework\Attributes\DataProvider('billList')] + #[\PHPUnit\Framework\Attributes\Group('maybe')] public function testIban($json, $content) : void { $identifierContent = \file_get_contents(__DIR__ . '/../../Models/bill_identifier.json'); @@ -154,10 +138,8 @@ final class InvoiceRecognitionTest extends \PHPUnit\Framework\TestCase ); } - /** - * @dataProvider billList - * @group maybe - */ + #[\PHPUnit\Framework\Attributes\DataProvider('billList')] + #[\PHPUnit\Framework\Attributes\Group('maybe')] public function testVATId($json, $content) : void { $identifierContent = \file_get_contents(__DIR__ . '/../../Models/bill_identifier.json'); @@ -184,10 +166,8 @@ final class InvoiceRecognitionTest extends \PHPUnit\Framework\TestCase ); } - /** - * @dataProvider billList - * @group maybe - */ + #[\PHPUnit\Framework\Attributes\DataProvider('billList')] + #[\PHPUnit\Framework\Attributes\Group('maybe')] public function testTaxId($json, $content) : void { $identifierContent = \file_get_contents(__DIR__ . '/../../Models/bill_identifier.json'); @@ -214,10 +194,8 @@ final class InvoiceRecognitionTest extends \PHPUnit\Framework\TestCase ); } - /** - * @dataProvider billList - * @group maybe - */ + #[\PHPUnit\Framework\Attributes\DataProvider('billList')] + #[\PHPUnit\Framework\Attributes\Group('maybe')] public function testWebsite($json, $content) : void { $identifierContent = \file_get_contents(__DIR__ . '/../../Models/bill_identifier.json'); @@ -244,10 +222,8 @@ final class InvoiceRecognitionTest extends \PHPUnit\Framework\TestCase ); } - /** - * @dataProvider billList - * @group maybe - */ + #[\PHPUnit\Framework\Attributes\DataProvider('billList')] + #[\PHPUnit\Framework\Attributes\Group('maybe')] public function testEmail($json, $content) : void { $identifierContent = \file_get_contents(__DIR__ . '/../../Models/bill_identifier.json'); @@ -274,10 +250,8 @@ final class InvoiceRecognitionTest extends \PHPUnit\Framework\TestCase ); } - /** - * @dataProvider billList - * @group maybe - */ + #[\PHPUnit\Framework\Attributes\DataProvider('billList')] + #[\PHPUnit\Framework\Attributes\Group('maybe')] public function testPhone($json, $content) : void { $identifierContent = \file_get_contents(__DIR__ . '/../../Models/bill_identifier.json'); @@ -306,7 +280,7 @@ final class InvoiceRecognitionTest extends \PHPUnit\Framework\TestCase public static array $billList = []; - public function billList() + public static function billList() { /* if (\str_ends_with(__DIR__ . '/bills/12.png', 'pdf')) { diff --git a/tests/Models/NullBillElementTest.php b/tests/Models/NullBillElementTest.php index 8c14a51..e75ec1b 100755 --- a/tests/Models/NullBillElementTest.php +++ b/tests/Models/NullBillElementTest.php @@ -19,31 +19,23 @@ use Modules\Billing\Models\NullBillElement; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Billing\Models\NullBillElement::class)] final class NullBillElementTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Billing\Models\NullBillElement - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\Billing\Models\BillElement', new NullBillElement()); } - /** - * @covers \Modules\Billing\Models\NullBillElement - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullBillElement(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\Billing\Models\NullBillElement - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullBillElement(2); diff --git a/tests/Models/NullBillTest.php b/tests/Models/NullBillTest.php index f46f06e..668e6e1 100755 --- a/tests/Models/NullBillTest.php +++ b/tests/Models/NullBillTest.php @@ -19,31 +19,23 @@ use Modules\Billing\Models\NullBill; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Billing\Models\NullBill::class)] final class NullBillTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Billing\Models\NullBill - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\Billing\Models\Bill', new NullBill()); } - /** - * @covers \Modules\Billing\Models\NullBill - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullBill(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\Billing\Models\NullBill - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullBill(2); diff --git a/tests/Models/NullBillTypeTest.php b/tests/Models/NullBillTypeTest.php index ff620d5..5c3b9f4 100755 --- a/tests/Models/NullBillTypeTest.php +++ b/tests/Models/NullBillTypeTest.php @@ -19,31 +19,23 @@ use Modules\Billing\Models\NullBillType; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Billing\Models\NullBillType::class)] final class NullBillTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Billing\Models\NullBillType - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\Billing\Models\BillType', new NullBillType()); } - /** - * @covers \Modules\Billing\Models\NullBillType - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullBillType(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\Billing\Models\NullBillType - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullBillType(2); diff --git a/tests/Models/NullSubscriptionTest.php b/tests/Models/NullSubscriptionTest.php index 13673b5..27efe39 100644 --- a/tests/Models/NullSubscriptionTest.php +++ b/tests/Models/NullSubscriptionTest.php @@ -19,31 +19,23 @@ use Modules\Billing\Models\NullSubscription; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Billing\Models\NullSubscription::class)] final class NullSubscriptionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Billing\Models\NullSubscription - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\Billing\Models\Subscription', new NullSubscription()); } - /** - * @covers \Modules\Billing\Models\NullSubscription - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullSubscription(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\Billing\Models\NullSubscription - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullSubscription(2); diff --git a/tests/Models/Price/NullPriceTest.php b/tests/Models/Price/NullPriceTest.php index af5b1f9..b39e0d7 100644 --- a/tests/Models/Price/NullPriceTest.php +++ b/tests/Models/Price/NullPriceTest.php @@ -19,31 +19,23 @@ use Modules\Billing\Models\Price\NullPrice; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Billing\Models\Price\NullPrice::class)] final class NullPriceTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Billing\Models\Price\NullPrice - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\Billing\Models\Price\Price', new NullPrice()); } - /** - * @covers \Modules\Billing\Models\Price\NullPrice - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullPrice(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\Billing\Models\Price\NullPrice - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullPrice(2); diff --git a/tests/Models/PurchaseBillMapperTest.php b/tests/Models/PurchaseBillMapperTest.php index f1d1933..abf52fe 100755 --- a/tests/Models/PurchaseBillMapperTest.php +++ b/tests/Models/PurchaseBillMapperTest.php @@ -17,124 +17,85 @@ namespace Modules\Billing\tests\Models; use Modules\Billing\Models\PurchaseBillMapper; /** - * @testdox Modules\Billing\tests\Models\PurchaseBillMapperTest: App database mapper - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Billing\Models\PurchaseBillMapper::class)] +#[\PHPUnit\Framework\Attributes\TestDox('Modules\Billing\tests\Models\PurchaseBillMapperTest: App database mapper')] final class PurchaseBillMapperTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Billing\Models\PurchaseBillMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetPurchaseBeforePivotInvalid() : void { self::assertEquals([], PurchaseBillMapper::getPurchaseBeforePivot(-1)); } - /** - * @covers \Modules\Billing\Models\PurchaseBillMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetPurchaseAfterPivotInvalid() : void { self::assertEquals([], PurchaseBillMapper::getPurchaseAfterPivot(99999)); } - /** - * @covers \Modules\Billing\Models\PurchaseBillMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetPurchaseByItemIdInvalid() : void { self::assertEquals(0, PurchaseBillMapper::getPurchaseByItemId(99999, new \DateTime('now'), new \DateTime('now'))->getInt()); } - /** - * @covers \Modules\Billing\Models\PurchaseBillMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetPurchaseBySupplierIdInvalid() : void { self::assertEquals(0, PurchaseBillMapper::getPurchaseBySupplierId(99999, new \DateTime('now'), new \DateTime('now'))->getInt()); } - /** - * @covers \Modules\Billing\Models\PurchaseBillMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetAvgPurchasePriceByItemIdInvalid() : void { self::assertEquals(0, PurchaseBillMapper::getAvgPurchasePriceByItemId(99999, new \DateTime('now'), new \DateTime('now'))->getInt()); } - /** - * @covers \Modules\Billing\Models\PurchaseBillMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetLastOrderDateByItemIdInvalid() : void { self::assertNull(PurchaseBillMapper::getLastOrderDateByItemId(99999)); } - /** - * @covers \Modules\Billing\Models\PurchaseBillMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetLastOrderDateBySupplierIdInvalid() : void { self::assertNull(PurchaseBillMapper::getLastOrderDateBySupplierId(99999)); } - /** - * @covers \Modules\Billing\Models\PurchaseBillMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetNewestItemInvoicesInvalid() : void { self::assertEquals([], PurchaseBillMapper::getNewestItemInvoices(99999)); } - /** - * @covers \Modules\Billing\Models\PurchaseBillMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetNewestSupplierInvoicesInvalid() : void { self::assertEquals([], PurchaseBillMapper::getNewestSupplierInvoices(99999)); } - /** - * @covers \Modules\Billing\Models\PurchaseBillMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetItemTopSuppliersInvalid() : void { self::assertEquals([[], []], PurchaseBillMapper::getItemTopSuppliers(99999, new \DateTime('now'), new \DateTime('now'))); } - /** - * @covers \Modules\Billing\Models\PurchaseBillMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetItemCountryPurchaseInvalid() : void { self::assertEquals([], PurchaseBillMapper::getItemCountryPurchase(99999, new \DateTime('now'), new \DateTime('now'))); } - /** - * @covers \Modules\Billing\Models\PurchaseBillMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetItemMonthlyPurchaseCostsInvalid() : void { self::assertEquals([], PurchaseBillMapper::getItemMonthlyPurchaseCosts(99999, new \DateTime('now'), new \DateTime('now'))); } - /** - * @covers \Modules\Billing\Models\PurchaseBillMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetSupplierMonthlyPurchaseCostsInvalid() : void { self::assertEquals([], PurchaseBillMapper::getSupplierMonthlyPurchaseCosts(99999, new \DateTime('now'), new \DateTime('now'))); diff --git a/tests/Models/SalesBillMapperTest.php b/tests/Models/SalesBillMapperTest.php index cfa8287..0929f9e 100755 --- a/tests/Models/SalesBillMapperTest.php +++ b/tests/Models/SalesBillMapperTest.php @@ -17,133 +17,91 @@ namespace Modules\Billing\tests\Models; use Modules\Billing\Models\SalesBillMapper; /** - * @testdox Modules\Billing\tests\Models\SalesBillMapperTest: App database mapper - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Billing\Models\SalesBillMapper::class)] +#[\PHPUnit\Framework\Attributes\TestDox('Modules\Billing\tests\Models\SalesBillMapperTest: App database mapper')] final class SalesBillMapperTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Billing\Models\SalesBillMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetSalesBeforePivotInvalid() : void { self::assertEquals([], SalesBillMapper::getSalesBeforePivot(-1)); } - /** - * @covers \Modules\Billing\Models\SalesBillMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetSalesAfterPivotInvalid() : void { self::assertEquals([], SalesBillMapper::getSalesAfterPivot(99999)); } - /** - * @covers \Modules\Billing\Models\SalesBillMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetSalesByItemIdInvalid() : void { self::assertEquals(0, SalesBillMapper::getSalesByItemId(99999, new \DateTime('now'), new \DateTime('now'))->getInt()); } - /** - * @covers \Modules\Billing\Models\SalesBillMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetSalesByClientIdInvalid() : void { self::assertEquals(0, SalesBillMapper::getSalesByClientId(99999, new \DateTime('now'), new \DateTime('now'))->getInt()); } - /** - * @covers \Modules\Billing\Models\SalesBillMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetLastOrderDateByItemIdInvalid() : void { self::assertNull(SalesBillMapper::getLastOrderDateByItemId(99999)); } - /** - * @covers \Modules\Billing\Models\SalesBillMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetLastOrderDateByClientIdInvalid() : void { self::assertNull(SalesBillMapper::getLastOrderDateByClientId(99999)); } - /** - * @covers \Modules\Billing\Models\SalesBillMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetNewestItemInvoicesInvalid() : void { self::assertEquals([], SalesBillMapper::getNewestItemInvoices(99999)); } - /** - * @covers \Modules\Billing\Models\SalesBillMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetNewestClientInvoicesInvalid() : void { self::assertEquals([], SalesBillMapper::getNewestClientInvoices(99999)); } - /** - * @covers \Modules\Billing\Models\SalesBillMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetItemTopClientsInvalid() : void { self::assertEquals([[], []], SalesBillMapper::getItemTopClients(99999, new \DateTime('now'), new \DateTime('now'))); } - /** - * @covers \Modules\Billing\Models\SalesBillMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetItemBillsInvalid() : void { self::assertEquals([], SalesBillMapper::getItemBills(99999, new \DateTime('now'), new \DateTime('now'))); } - /** - * @covers \Modules\Billing\Models\SalesBillMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetClientItem() : void { self::assertEquals([], SalesBillMapper::getClientItem(99999, new \DateTime('now'), new \DateTime('now'))); } - /** - * @covers \Modules\Billing\Models\SalesBillMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetItemCountrySalesInvalid() : void { self::assertEquals([], SalesBillMapper::getItemCountrySales(99999, new \DateTime('now'), new \DateTime('now'))); } - /** - * @covers \Modules\Billing\Models\SalesBillMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetItemMonthlySalesCostsInvalid() : void { self::assertEquals([], SalesBillMapper::getItemMonthlySalesCosts([99999], new \DateTime('now'), new \DateTime('now'))); } - /** - * @covers \Modules\Billing\Models\SalesBillMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetClientMonthlySalesCostsInvalid() : void { self::assertEquals([], SalesBillMapper::getClientMonthlySalesCosts(99999, new \DateTime('now'), new \DateTime('now'))); diff --git a/tests/Models/StockBillMapperTest.php b/tests/Models/StockBillMapperTest.php index 4d28e81..f23c4e4 100755 --- a/tests/Models/StockBillMapperTest.php +++ b/tests/Models/StockBillMapperTest.php @@ -17,25 +17,19 @@ namespace Modules\Billing\tests\Models; use Modules\Billing\Models\StockBillMapper; /** - * @testdox Modules\Billing\tests\Models\StockBillMapperTest: App database mapper - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Billing\Models\StockBillMapper::class)] +#[\PHPUnit\Framework\Attributes\TestDox('Modules\Billing\tests\Models\StockBillMapperTest: App database mapper')] final class StockBillMapperTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Billing\Models\StockBillMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetStockBeforePivotInvalid() : void { self::assertEquals([], StockBillMapper::getStockBeforePivot(-1)); } - /** - * @covers \Modules\Billing\Models\StockBillMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetStockAfterPivotInvalid() : void { self::assertEquals([], StockBillMapper::getStockAfterPivot(99999)); diff --git a/tests/Models/Tax/NullTaxCombinationTest.php b/tests/Models/Tax/NullTaxCombinationTest.php index 392d048..62e331d 100644 --- a/tests/Models/Tax/NullTaxCombinationTest.php +++ b/tests/Models/Tax/NullTaxCombinationTest.php @@ -19,31 +19,23 @@ use Modules\Billing\Models\Tax\NullTaxCombination; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Billing\Models\Tax\NullTaxCombination::class)] final class NullTaxCombinationTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Billing\Models\Tax\NullTaxCombination - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\Billing\Models\Tax\TaxCombination', new NullTaxCombination()); } - /** - * @covers \Modules\Billing\Models\Tax\NullTaxCombination - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullTaxCombination(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\Billing\Models\Tax\NullTaxCombination - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullTaxCombination(2); diff --git a/tests/phpunit_default.xml b/tests/phpunit_default.xml index d350430..e4a5639 100755 --- a/tests/phpunit_default.xml +++ b/tests/phpunit_default.xml @@ -1,31 +1,6 @@ - - - - ../ - - - ../vendor* - ../MainRepository* - ../Karaka* - ../Admin/Install/Application* - ../phpOMS* - ../tests* - ../*/tests* - ../**/tests* - */tests* - ../* - ../* - ../* - ../* - ../* - ../**/test* - ../**/Theme* - ../**/Admin/Routes* - ../**/Admin/Hooks* - ../**/Admin/Install* - ../Media/Files* - + + @@ -56,4 +31,31 @@ + + + ../ + + + ../vendor* + ../MainRepository* + ../Karaka* + ../Admin/Install/Application* + ../phpOMS* + ../tests* + ../*/tests* + ../**/tests* + */tests* + ../* + ../* + ../* + ../* + ../* + ../**/test* + ../**/Theme* + ../**/Admin/Routes* + ../**/Admin/Hooks* + ../**/Admin/Install* + ../Media/Files* + +