Skip to content

Commit

Permalink
tests - cover request data mapper not implemented methods
Browse files Browse the repository at this point in the history
  • Loading branch information
mustapayev committed Sep 7, 2024
1 parent 70fbfb2 commit 9df0a70
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

/**
* @covers \Mews\Pos\DataMapper\RequestDataMapper\PayFlexCPV4PosRequestDataMapper
* @covers \Mews\Pos\DataMapper\RequestDataMapper\AbstractRequestDataMapper
*/
class PayFlexCPV4PosRequestDataMapperTest extends TestCase
{
Expand Down Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

/**
* @covers \Mews\Pos\DataMapper\RequestDataMapper\PosNetRequestDataMapper
* @covers \Mews\Pos\DataMapper\RequestDataMapper\AbstractRequestDataMapper
*/
class PosNetRequestDataMapperTest extends TestCase
{
Expand Down Expand Up @@ -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 [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

/**
* @covers \Mews\Pos\DataMapper\RequestDataMapper\PosNetV1PosRequestDataMapper
* @covers \Mews\Pos\DataMapper\RequestDataMapper\AbstractRequestDataMapper
*/
class PosNetV1PosRequestDataMapperTest extends TestCase
{
Expand Down Expand Up @@ -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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

/**
* @covers \Mews\Pos\DataMapper\RequestDataMapper\ToslaPosRequestDataMapper
* @covers \Mews\Pos\DataMapper\RequestDataMapper\AbstractRequestDataMapper
*/
class ToslaPosRequestDataMapperTest extends TestCase
{
Expand Down Expand Up @@ -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 [
Expand Down

0 comments on commit 9df0a70

Please sign in to comment.