diff --git a/.travis.yml b/.travis.yml index 9e19205..d685e83 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,15 @@ language: php php: - - 7.1 - 7.2 - 7.3 +env: + - JMS=0.12 + - JMS=1.0 + - JMS=2.0 + - JMS=3.0 + before_install: - composer selfupdate - - composer install --dev --no-interaction --prefer-dist + - composer require jms/serializer=^$JMS --no-interaction --prefer-dist diff --git a/composer.json b/composer.json index 77f32eb..0e2402f 100644 --- a/composer.json +++ b/composer.json @@ -10,17 +10,17 @@ } ], "require": { - "php": ">=7.1", + "php": ">=7.2", "ext-curl": "*", "ext-json": "*", "guzzlehttp/guzzle": "~6.3", - "jms/serializer": "~0.12 || ~1.4.2", + "jms/serializer": "~0.12|~1.0|~2.0|~3.0", "symfony/validator": "~2.8|~3.0|~4.0", "doctrine/cache": "~1.6", "psr/log": "~1.0" }, "require-dev": { - "phpunit/phpunit": "~7.0" + "phpunit/phpunit": "~8.0" }, "support": { "email": "support@retailcrm.ru" diff --git a/tests/AtolOnlineClient/AtolOnlineTest.php b/tests/AtolOnlineClient/AtolOnlineTest.php index 0199f30..b9f58f7 100644 --- a/tests/AtolOnlineClient/AtolOnlineTest.php +++ b/tests/AtolOnlineClient/AtolOnlineTest.php @@ -160,7 +160,7 @@ class AtolOnlineTest extends TestCase $request->setTimestamp('17.07.2019 10:14:22'); $this->assertEquals( - '{"external_id":"test","receipt":{"client":{"email":"test@test.local"},"company":{"email":"test@test.local","inn":"11111111","payment_address":"address"},"items":[{"name":"test item","price":100,"quantity":1,"sum":100,"measurement_unit":"kg","payment_method":"advance","payment_object":"agent_commission","vat":{"type":"vat20","sum":20},"nomenclature_code":"00"}],"payments":[{"type":0,"sum":100}],"vats":[{"type":"vat20","sum":20}],"total":100},"timestamp":"17.07.2019 10:14:22","service":{"callback_url":"test.local"}}', + '{"external_id":"test","receipt":{"client":{"email":"test@test.local"},"company":{"email":"test@test.local","inn":"11111111","payment_address":"address"},"items":[{"name":"test item","price":100.1,"quantity":1,"sum":100.1,"measurement_unit":"kg","payment_method":"advance","payment_object":"agent_commission","vat":{"type":"vat20","sum":20.2},"nomenclature_code":"00"}],"payments":[{"type":0,"sum":100.1}],"vats":[{"type":"vat20","sum":20.2}],"total":100.1},"timestamp":"17.07.2019 10:14:22","service":{"callback_url":"test.local"}}', $this->atol->serializeOperationRequest($request) ); } diff --git a/tests/AtolOnlineClient/Traits/PaymentReceiptRequestTrait.php b/tests/AtolOnlineClient/Traits/PaymentReceiptRequestTrait.php index e3d48fc..5933dce 100644 --- a/tests/AtolOnlineClient/Traits/PaymentReceiptRequestTrait.php +++ b/tests/AtolOnlineClient/Traits/PaymentReceiptRequestTrait.php @@ -30,22 +30,22 @@ trait PaymentReceiptRequestTrait $item = new ReceiptItemRequest(); $item->setName('test item'); - $item->setPrice(100); + $item->setPrice(100.1); $item->setQuantity(1); - $item->setSum(100); + $item->setSum(100.1); $item->setMeasurementUnit('kg'); $item->setPaymentMethod(ReceiptItemRequest::PAYMENT_METHOD_ADVANCE); $item->setPaymentObject(ReceiptItemRequest::PAYMENT_OBJECT_AGENT_COMMISSION); - $item->setVat(new VatReceiptRequest('vat20', 20)); + $item->setVat(new VatReceiptRequest('vat20', 20.2)); $item->setNomenclatureCode('00'); $receipt = new ReceiptRequest(); - $receipt->setTotal('100'); + $receipt->setTotal(100.1); $receipt->setClient($client); $receipt->setCompany($company); $receipt->setItems([$item]); - $receipt->setPayments([new ReceiptPaymentRequest(0, 100)]); - $receipt->setVats([new VatReceiptRequest('vat20', 20)]); + $receipt->setPayments([new ReceiptPaymentRequest(0, 100.1)]); + $receipt->setVats([new VatReceiptRequest('vat20', 20.2)]); /** @var PaymentReceiptRequest $request */ $request = new PaymentReceiptRequest();