From 9df0a701de8a240826e451ce3780c98e6783c4d2 Mon Sep 17 00:00:00 2001 From: mustapayev Date: Sat, 7 Sep 2024 18:01:31 +0200 Subject: [PATCH] tests - cover request data mapper not implemented methods --- .../EstPosRequestDataMapperTest.php | 6 ++++ .../PayFlexCPV4PosRequestDataMapperTest.php | 32 +++++++++++++++++-- .../PosNetRequestDataMapperTest.php | 13 ++++++++ .../PosNetV1PosRequestDataMapperTest.php | 13 ++++++++ .../ToslaPosRequestDataMapperTest.php | 19 +++++++++++ 5 files changed, 81 insertions(+), 2 deletions(-) diff --git a/tests/Unit/DataMapper/RequestDataMapper/EstPosRequestDataMapperTest.php b/tests/Unit/DataMapper/RequestDataMapper/EstPosRequestDataMapperTest.php index 629bcfe4..8dcbea4a 100644 --- a/tests/Unit/DataMapper/RequestDataMapper/EstPosRequestDataMapperTest.php +++ b/tests/Unit/DataMapper/RequestDataMapper/EstPosRequestDataMapperTest.php @@ -203,6 +203,12 @@ public function testCreateOrderHistoryRequestData(array $order, array $expected) $this->assertEquals($expected, $actual); } + public function testCreateHistoryRequestData(): void + { + $this->expectException(\Mews\Pos\Exceptions\NotImplementedException::class); + $this->requestDataMapper->createHistoryRequestData($this->account); + } + /** * @dataProvider threeDPaymentRequestDataDataProvider */ diff --git a/tests/Unit/DataMapper/RequestDataMapper/PayFlexCPV4PosRequestDataMapperTest.php b/tests/Unit/DataMapper/RequestDataMapper/PayFlexCPV4PosRequestDataMapperTest.php index 988b09ef..920c0b15 100644 --- a/tests/Unit/DataMapper/RequestDataMapper/PayFlexCPV4PosRequestDataMapperTest.php +++ b/tests/Unit/DataMapper/RequestDataMapper/PayFlexCPV4PosRequestDataMapperTest.php @@ -23,6 +23,7 @@ /** * @covers \Mews\Pos\DataMapper\RequestDataMapper\PayFlexCPV4PosRequestDataMapper + * @covers \Mews\Pos\DataMapper\RequestDataMapper\AbstractRequestDataMapper */ class PayFlexCPV4PosRequestDataMapperTest extends TestCase { @@ -159,10 +160,37 @@ public function testCreate3DFormData(array $queryParams, array $expected): void $this->assertSame($expected, $actualData); } - public static function registerDataProvider(): iterable + public function testCreate3DPaymentRequestData(): void + { + $this->expectException(\Mews\Pos\Exceptions\NotImplementedException::class); + $this->requestDataMapper->create3DPaymentRequestData( + $this->account, + [], + PosInterface::TX_TYPE_PAY_AUTH, + [] + ); + } + + public function testCreateStatusRequestData(): void + { + $this->expectException(\Mews\Pos\Exceptions\NotImplementedException::class); + $this->requestDataMapper->createStatusRequestData($this->account, []); + } + + public function testCreateHistoryRequestData(): void { - $config = require __DIR__.'/../../../../config/pos_test.php'; + $this->expectException(\Mews\Pos\Exceptions\NotImplementedException::class); + $this->requestDataMapper->createHistoryRequestData($this->account); + } + public function testCreateOrderHistoryRequestData(): void + { + $this->expectException(\Mews\Pos\Exceptions\NotImplementedException::class); + $this->requestDataMapper->createOrderHistoryRequestData($this->account, []); + } + + public static function registerDataProvider(): iterable + { $account = AccountFactory::createPayFlexAccount( 'vakifbank-cp', '000000000111111', diff --git a/tests/Unit/DataMapper/RequestDataMapper/PosNetRequestDataMapperTest.php b/tests/Unit/DataMapper/RequestDataMapper/PosNetRequestDataMapperTest.php index 6c23fa7d..0db57dbb 100644 --- a/tests/Unit/DataMapper/RequestDataMapper/PosNetRequestDataMapperTest.php +++ b/tests/Unit/DataMapper/RequestDataMapper/PosNetRequestDataMapperTest.php @@ -22,6 +22,7 @@ /** * @covers \Mews\Pos\DataMapper\RequestDataMapper\PosNetRequestDataMapper + * @covers \Mews\Pos\DataMapper\RequestDataMapper\AbstractRequestDataMapper */ class PosNetRequestDataMapperTest extends TestCase { @@ -270,6 +271,18 @@ public function testCreateRefundRequestData(array $order, string $txType, array $this->assertSame($expectedData, $actual); } + public function testCreateHistoryRequestData(): void + { + $this->expectException(\Mews\Pos\Exceptions\NotImplementedException::class); + $this->requestDataMapper->createHistoryRequestData($this->account); + } + + public function testCreateOrderHistoryRequestData(): void + { + $this->expectException(\Mews\Pos\Exceptions\NotImplementedException::class); + $this->requestDataMapper->createOrderHistoryRequestData($this->account, []); + } + public static function threeDFormDataDataProvider(): array { return [ diff --git a/tests/Unit/DataMapper/RequestDataMapper/PosNetV1PosRequestDataMapperTest.php b/tests/Unit/DataMapper/RequestDataMapper/PosNetV1PosRequestDataMapperTest.php index c88de79c..bed064c1 100644 --- a/tests/Unit/DataMapper/RequestDataMapper/PosNetV1PosRequestDataMapperTest.php +++ b/tests/Unit/DataMapper/RequestDataMapper/PosNetV1PosRequestDataMapperTest.php @@ -23,6 +23,7 @@ /** * @covers \Mews\Pos\DataMapper\RequestDataMapper\PosNetV1PosRequestDataMapper + * @covers \Mews\Pos\DataMapper\RequestDataMapper\AbstractRequestDataMapper */ class PosNetV1PosRequestDataMapperTest extends TestCase { @@ -235,6 +236,18 @@ public function testCreateCancelRequestData(array $order, array $expected): void $this->assertEquals($expected, $actual); } + public function testCreateHistoryRequestData(): void + { + $this->expectException(\Mews\Pos\Exceptions\NotImplementedException::class); + $this->requestDataMapper->createHistoryRequestData($this->account); + } + + public function testCreateOrderHistoryRequestData(): void + { + $this->expectException(\Mews\Pos\Exceptions\NotImplementedException::class); + $this->requestDataMapper->createOrderHistoryRequestData($this->account, []); + } + /** * @return array */ diff --git a/tests/Unit/DataMapper/RequestDataMapper/ToslaPosRequestDataMapperTest.php b/tests/Unit/DataMapper/RequestDataMapper/ToslaPosRequestDataMapperTest.php index bf04cad4..75c02d00 100644 --- a/tests/Unit/DataMapper/RequestDataMapper/ToslaPosRequestDataMapperTest.php +++ b/tests/Unit/DataMapper/RequestDataMapper/ToslaPosRequestDataMapperTest.php @@ -19,6 +19,7 @@ /** * @covers \Mews\Pos\DataMapper\RequestDataMapper\ToslaPosRequestDataMapper + * @covers \Mews\Pos\DataMapper\RequestDataMapper\AbstractRequestDataMapper */ class ToslaPosRequestDataMapperTest extends TestCase { @@ -250,6 +251,24 @@ public function testCreateRefundRequestData(array $order, string $txType, array $this->assertSame($expected, $actual); } + public function testCreate3DPaymentRequestData(): void + { + $this->expectException(\Mews\Pos\Exceptions\NotImplementedException::class); + $this->requestDataMapper->create3DPaymentRequestData( + $this->account, + [], + PosInterface::TX_TYPE_PAY_AUTH, + [] + ); + } + + public function testCreateHistoryRequestData(): void + { + $this->expectException(\Mews\Pos\Exceptions\NotImplementedException::class); + $this->requestDataMapper->createHistoryRequestData($this->account); + } + + public static function statusRequestDataProvider(): array { return [