From 7f94b3fe3a295b217a3a10db30f227d9f25d7626 Mon Sep 17 00:00:00 2001 From: Sysix Date: Sat, 23 Dec 2023 13:38:09 +0100 Subject: [PATCH] fix deprecated tests + add strict type cs rule --- .php-cs-fixer.dist.php | 1 + src/Utils.php | 2 ++ tests/Clients/CreditNoteTest.php | 4 ++-- tests/Clients/DeliveryNoteTest.php | 4 ++-- tests/Clients/DownPaymentInvoiceTest.php | 2 +- tests/Clients/InvoiceTest.php | 4 ++-- tests/Clients/OrderConfirmationTest.php | 4 ++-- tests/Clients/QuotationTest.php | 2 +- tests/Clients/VoucherTest.php | 2 +- 9 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 578add9..d937104 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -10,6 +10,7 @@ ->setRiskyAllowed(true) ->setRules([ '@PSR12' => true, + 'declare_strict_types' => true, 'modernize_types_casting' => true, 'multiline_comment_opening_closing' => true, 'multiline_whitespace_before_semicolons' => true, diff --git a/src/Utils.php b/src/Utils.php index 65339a4..4e6653d 100644 --- a/src/Utils.php +++ b/src/Utils.php @@ -1,5 +1,7 @@ assertEquals('GET', $api->getRequest()->getMethod()); $this->assertEquals( - $api->apiUrl . '/v1/voucherlist?page=0&sort=voucherNumber%2CDESC&voucherType=creditnote&voucherStatus=draft%2Copen%2Cpaid%2Cpaidoff%2Cvoided%2Caccepted%2Crejected&size=100', + $api->apiUrl . '/v1/voucherlist?page=0&voucherType=creditnote&voucherStatus=draft%2Copen%2Cpaid%2Cpaidoff%2Cvoided%2Caccepted%2Crejected&size=100&sort=voucherNumber%2CDESC', $api->getRequest()->getUri()->__toString() ); } @@ -127,7 +127,7 @@ public function testGetAll(): void $this->assertEquals('GET', $api->getRequest()->getMethod()); $this->assertEquals( - $api->apiUrl . '/v1/voucherlist?page=0&sort=voucherNumber%2CDESC&voucherType=creditnote&voucherStatus=draft%2Copen%2Cpaid%2Cpaidoff%2Cvoided%2Caccepted%2Crejected&size=100', + $api->apiUrl . '/v1/voucherlist?page=0&voucherType=creditnote&voucherStatus=draft%2Copen%2Cpaid%2Cpaidoff%2Cvoided%2Caccepted%2Crejected&size=100&sort=voucherNumber%2CDESC', $api->getRequest()->getUri()->__toString() ); } diff --git a/tests/Clients/DeliveryNoteTest.php b/tests/Clients/DeliveryNoteTest.php index 230e05d..ed2d458 100644 --- a/tests/Clients/DeliveryNoteTest.php +++ b/tests/Clients/DeliveryNoteTest.php @@ -73,7 +73,7 @@ public function testGetPage(): void $this->assertEquals('GET', $api->getRequest()->getMethod()); $this->assertEquals( - $api->apiUrl . '/v1/voucherlist?page=0&sort=voucherNumber%2CDESC&voucherType=deliverynote&voucherStatus=draft%2Copen%2Cpaid%2Cpaidoff%2Cvoided%2Caccepted%2Crejected&size=100', + $api->apiUrl . '/v1/voucherlist?page=0&voucherType=deliverynote&voucherStatus=draft%2Copen%2Cpaid%2Cpaidoff%2Cvoided%2Caccepted%2Crejected&size=100&sort=voucherNumber%2CDESC', $api->getRequest()->getUri()->__toString() ); } @@ -93,7 +93,7 @@ public function testGetAll(): void $this->assertEquals('GET', $api->getRequest()->getMethod()); $this->assertEquals( - $api->apiUrl . '/v1/voucherlist?page=0&sort=voucherNumber%2CDESC&voucherType=deliverynote&voucherStatus=draft%2Copen%2Cpaid%2Cpaidoff%2Cvoided%2Caccepted%2Crejected&size=100', + $api->apiUrl . '/v1/voucherlist?page=0&voucherType=deliverynote&voucherStatus=draft%2Copen%2Cpaid%2Cpaidoff%2Cvoided%2Caccepted%2Crejected&size=100&sort=voucherNumber%2CDESC', $api->getRequest()->getUri()->__toString() ); } diff --git a/tests/Clients/DownPaymentInvoiceTest.php b/tests/Clients/DownPaymentInvoiceTest.php index 50b0528..98572d9 100644 --- a/tests/Clients/DownPaymentInvoiceTest.php +++ b/tests/Clients/DownPaymentInvoiceTest.php @@ -42,7 +42,7 @@ public function testGetAll(): void $this->assertEquals('GET', $api->getRequest()->getMethod()); $this->assertEquals( - $api->apiUrl . '/v1/voucherlist?page=0&sort=voucherNumber%2CDESC&voucherType=downpaymentinvoice&voucherStatus=draft%2Copen%2Cpaid%2Cpaidoff%2Cvoided%2Caccepted%2Crejected&size=100', + $api->apiUrl . '/v1/voucherlist?page=0&voucherType=downpaymentinvoice&voucherStatus=draft%2Copen%2Cpaid%2Cpaidoff%2Cvoided%2Caccepted%2Crejected&size=100&sort=voucherNumber%2CDESC', $api->getRequest()->getUri()->__toString() ); } diff --git a/tests/Clients/InvoiceTest.php b/tests/Clients/InvoiceTest.php index a8a5a9b..e53e8c6 100644 --- a/tests/Clients/InvoiceTest.php +++ b/tests/Clients/InvoiceTest.php @@ -107,7 +107,7 @@ public function testPage(): void $this->assertEquals('GET', $api->getRequest()->getMethod()); $this->assertEquals( - $api->apiUrl . '/v1/voucherlist?page=0&sort=voucherNumber%2CDESC&voucherType=invoice&voucherStatus=draft%2Copen%2Cpaid%2Cpaidoff%2Cvoided%2Caccepted%2Crejected&size=100', + $api->apiUrl . '/v1/voucherlist?page=0&voucherType=invoice&voucherStatus=draft%2Copen%2Cpaid%2Cpaidoff%2Cvoided%2Caccepted%2Crejected&size=100&sort=voucherNumber%2CDESC', $api->getRequest()->getUri()->__toString() ); } @@ -127,7 +127,7 @@ public function testGetAll(): void $this->assertEquals('GET', $api->getRequest()->getMethod()); $this->assertEquals( - $api->apiUrl . '/v1/voucherlist?page=0&sort=voucherNumber%2CDESC&voucherType=invoice&voucherStatus=draft%2Copen%2Cpaid%2Cpaidoff%2Cvoided%2Caccepted%2Crejected&size=100', + $api->apiUrl . '/v1/voucherlist?page=0&voucherType=invoice&voucherStatus=draft%2Copen%2Cpaid%2Cpaidoff%2Cvoided%2Caccepted%2Crejected&size=100&sort=voucherNumber%2CDESC', $api->getRequest()->getUri()->__toString() ); } diff --git a/tests/Clients/OrderConfirmationTest.php b/tests/Clients/OrderConfirmationTest.php index 5637fdc..792e5cf 100644 --- a/tests/Clients/OrderConfirmationTest.php +++ b/tests/Clients/OrderConfirmationTest.php @@ -73,7 +73,7 @@ public function testGetPage(): void $this->assertEquals('GET', $api->getRequest()->getMethod()); $this->assertEquals( - $api->apiUrl . '/v1/voucherlist?page=0&sort=voucherNumber%2CDESC&voucherType=orderconfirmation&voucherStatus=draft%2Copen%2Cpaid%2Cpaidoff%2Cvoided%2Caccepted%2Crejected&size=100', + $api->apiUrl . '/v1/voucherlist?page=0&voucherType=orderconfirmation&voucherStatus=draft%2Copen%2Cpaid%2Cpaidoff%2Cvoided%2Caccepted%2Crejected&size=100&sort=voucherNumber%2CDESC', $api->getRequest()->getUri()->__toString() ); } @@ -93,7 +93,7 @@ public function testGetAll(): void $this->assertEquals('GET', $api->getRequest()->getMethod()); $this->assertEquals( - $api->apiUrl . '/v1/voucherlist?page=0&sort=voucherNumber%2CDESC&voucherType=orderconfirmation&voucherStatus=draft%2Copen%2Cpaid%2Cpaidoff%2Cvoided%2Caccepted%2Crejected&size=100', + $api->apiUrl . '/v1/voucherlist?page=0&voucherType=orderconfirmation&voucherStatus=draft%2Copen%2Cpaid%2Cpaidoff%2Cvoided%2Caccepted%2Crejected&size=100&sort=voucherNumber%2CDESC', $api->getRequest()->getUri()->__toString() ); } diff --git a/tests/Clients/QuotationTest.php b/tests/Clients/QuotationTest.php index daa0206..5f92275 100644 --- a/tests/Clients/QuotationTest.php +++ b/tests/Clients/QuotationTest.php @@ -76,7 +76,7 @@ public function testGetAll(): void $this->assertEquals('GET', $api->getRequest()->getMethod()); $this->assertEquals( - $api->apiUrl . '/v1/voucherlist?page=0&sort=voucherNumber%2CDESC&voucherType=quotation&voucherStatus=draft%2Copen%2Cpaid%2Cpaidoff%2Cvoided%2Caccepted%2Crejected&size=100', + $api->apiUrl . '/v1/voucherlist?page=0&voucherType=quotation&voucherStatus=draft%2Copen%2Cpaid%2Cpaidoff%2Cvoided%2Caccepted%2Crejected&size=100&sort=voucherNumber%2CDESC', $api->getRequest()->getUri()->__toString() ); } diff --git a/tests/Clients/VoucherTest.php b/tests/Clients/VoucherTest.php index 0917d27..d0a7021 100644 --- a/tests/Clients/VoucherTest.php +++ b/tests/Clients/VoucherTest.php @@ -150,7 +150,7 @@ public function testGetAll(): void $this->assertEquals('GET', $api->getRequest()->getMethod()); $this->assertEquals( - $api->apiUrl . '/v1/voucherlist?page=0&sort=voucherNumber%2CDESC&voucherType=salesinvoice%2Csalescreditnote%2Cpurchaseinvoice%2Cpurchasecreditnote&voucherStatus=open%2Cpaid%2Cpaidoff%2Cvoided%2Ctransferred%2Csepadebit&size=100', + $api->apiUrl . '/v1/voucherlist?page=0&voucherType=salesinvoice%2Csalescreditnote%2Cpurchaseinvoice%2Cpurchasecreditnote&voucherStatus=open%2Cpaid%2Cpaidoff%2Cvoided%2Ctransferred%2Csepadebit&size=100&sort=voucherNumber%2CDESC', $api->getRequest()->getUri()->__toString() ); }