From bb16c758d3b2391a444a7b677f7817097e770340 Mon Sep 17 00:00:00 2001 From: mustapayev Date: Sat, 12 Oct 2024 13:16:46 +0200 Subject: [PATCH] tests - working on test coverage --- .../EstPosRequestDataMapperTest.php | 12 ------------ .../EstPosResponseDataMapperTest.php | 8 +++++++- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/tests/Unit/DataMapper/RequestDataMapper/EstPosRequestDataMapperTest.php b/tests/Unit/DataMapper/RequestDataMapper/EstPosRequestDataMapperTest.php index 72343c90..225d5ab1 100644 --- a/tests/Unit/DataMapper/RequestDataMapper/EstPosRequestDataMapperTest.php +++ b/tests/Unit/DataMapper/RequestDataMapper/EstPosRequestDataMapperTest.php @@ -38,8 +38,6 @@ class EstPosRequestDataMapperTest extends TestCase /** @var EventDispatcherInterface & MockObject */ private EventDispatcherInterface $dispatcher; - private array $order; - protected function setUp(): void { parent::setUp(); @@ -53,16 +51,6 @@ protected function setUp(): void 'TRPS0200' ); - $this->order = [ - 'id' => 'order222', - 'ip' => '127.0.0.1', - 'amount' => '100.25', - 'installment' => 0, - 'currency' => PosInterface::CURRENCY_TRY, - 'success_url' => 'https://domain.com/success', - 'fail_url' => 'https://domain.com/fail_url', - 'lang' => PosInterface::LANG_TR, - ]; $this->dispatcher = $this->createMock(EventDispatcherInterface::class); $this->crypt = $this->createMock(CryptInterface::class); diff --git a/tests/Unit/DataMapper/ResponseDataMapper/EstPosResponseDataMapperTest.php b/tests/Unit/DataMapper/ResponseDataMapper/EstPosResponseDataMapperTest.php index ede214f3..f1c1945d 100644 --- a/tests/Unit/DataMapper/ResponseDataMapper/EstPosResponseDataMapperTest.php +++ b/tests/Unit/DataMapper/ResponseDataMapper/EstPosResponseDataMapperTest.php @@ -8,6 +8,7 @@ use Mews\Pos\Crypt\CryptInterface; use Mews\Pos\DataMapper\RequestDataMapper\EstPosRequestDataMapper; use Mews\Pos\DataMapper\ResponseDataMapper\EstPosResponseDataMapper; +use Mews\Pos\Exceptions\NotImplementedException; use Mews\Pos\PosInterface; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -197,7 +198,7 @@ public function testMapCancelResponse(array $responseData, array $expectedData): /** * @dataProvider orderHistoryTestDataProvider */ - public function testMapHistoryResponse(array $responseData, array $expectedData): void + public function testMapOrderHistoryResponse(array $responseData, array $expectedData): void { $actualData = $this->responseDataMapper->mapOrderHistoryResponse($responseData); if (count($responseData['Extra']) > 0) { @@ -228,6 +229,11 @@ public function testMapHistoryResponse(array $responseData, array $expectedData) $this->assertSame($expectedData, $actualData); } + public function testMapHistoryResponse(): void + { + $this->expectException(NotImplementedException::class); + $this->responseDataMapper->mapHistoryResponse([]); + } public static function paymentTestDataProvider(): iterable {