Skip to content

Commit

Permalink
tests - working on test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
mustapayev committed Oct 12, 2024
1 parent 391db45 commit bb16c75
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ class EstPosRequestDataMapperTest extends TestCase
/** @var EventDispatcherInterface & MockObject */
private EventDispatcherInterface $dispatcher;

private array $order;

protected function setUp(): void
{
parent::setUp();
Expand All @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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
{
Expand Down

0 comments on commit bb16c75

Please sign in to comment.