upgrade phpunit

This commit is contained in:
Dennis Eichhorn 2024-03-20 05:15:59 +00:00
parent 5917c262f0
commit 7520fdfde7
16 changed files with 129 additions and 310 deletions

View File

@ -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();

View File

@ -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;

View File

@ -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;

View File

@ -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';

View File

@ -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');

View File

@ -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')) {

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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')));

View File

@ -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')));

View File

@ -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));

View File

@ -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);

View File

@ -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>