Skip to content

Commit

Permalink
tests: remove unused property from functional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mustapayev committed Jan 25, 2025
1 parent 55eb682 commit 5b2313a
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 50 deletions.
2 changes: 0 additions & 2 deletions tests/Functional/AkbankPosTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ class AkbankPosTest extends TestCase
/** @var \Mews\Pos\Gateways\AkbankPos */
private PosInterface $recurringPos;

private array $lastResponse;

protected function setUp(): void
{
parent::setUp();
Expand Down
4 changes: 0 additions & 4 deletions tests/Functional/EstV3PosTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ class EstV3PosTest extends TestCase
/** @var EstV3Pos */
private PosInterface $pos;

private array $lastResponse;

protected function setUp(): void
{
parent::setUp();
Expand All @@ -48,8 +46,6 @@ protected function setUp(): void

$this->pos = PosFactory::createPosGateway($account, $config, $this->eventDispatcher);

$this->pos->setTestMode(true);

$this->card = CreditCardFactory::createForGateway(
$this->pos,
'4546711234567894',
Expand Down
2 changes: 0 additions & 2 deletions tests/Functional/GarantiPosTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ class GarantiPosTest extends TestCase
/** @var GarantiPos */
private PosInterface $pos;

private array $lastResponse;

protected function setUp(): void
{
parent::setUp();
Expand Down
37 changes: 1 addition & 36 deletions tests/Functional/KuveytPosTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ class KuveytPosTest extends TestCase
/** @var \Mews\Pos\Gateways\KuveytPos */
private PosInterface $pos;

private array $lastResponse;

protected function setUp(): void
{
parent::setUp();
Expand All @@ -44,8 +42,6 @@ protected function setUp(): void

$this->pos = PosFactory::createPosGateway($account, $config, $this->eventDispatcher);

$this->pos->setTestMode(true);

$this->card = CreditCardFactory::createForGateway(
$this->pos,
'5188961939192544',
Expand Down Expand Up @@ -174,7 +170,7 @@ function (RequestDataPreparedEvent $requestDataPreparedEvent) use (&$eventIsThro
}

/**
* @depends testFullRefundFail
* @depends testStatusSuccess
*/
public function testCancelSuccess(array $lastResponse): array
{
Expand Down Expand Up @@ -307,35 +303,4 @@ function (RequestDataPreparedEvent $requestDataPreparedEvent) use (&$eventIsThro

return $lastResponse;
}

public function testCustomQuery(): void
{
$customQuery = [
'SecureType' => 'Inquiry',
'TxnType' => 'ParaPuanInquiry',
'Pan' => $card->getNumber(),
'Expiry' => $card->getExpirationDate(\Mews\Pos\DataMapper\RequestDataMapper\PayForPosRequestDataMapper::CREDIT_CARD_EXP_DATE_FORMAT),
'Cvv2' => $card->getCvv(),
];


$eventIsThrown = false;
$this->eventDispatcher->addListener(
RequestDataPreparedEvent::class,
function (RequestDataPreparedEvent $requestDataPreparedEvent) use (&$eventIsThrown): void {
$eventIsThrown = true;
$this->assertSame(PosInterface::TX_TYPE_CUSTOM_QUERY, $requestDataPreparedEvent->getTxType());
$this->assertCount(6, $requestDataPreparedEvent->getRequestData());
}
);

$this->pos->customQuery($customQuery);

$response = $this->pos->getResponse();

$this->assertIsArray($response);
$this->assertNotEmpty($response);
$this->assertArrayHasKey('Transaction', $response);
$this->assertTrue($eventIsThrown);
}
}
3 changes: 0 additions & 3 deletions tests/Functional/PayForPosTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ class PayForPosTest extends TestCase
/** @var PayForPos */
private PosInterface $pos;

private array $lastResponse;

protected function setUp(): void
{
parent::setUp();
Expand All @@ -47,7 +45,6 @@ protected function setUp(): void
$this->eventDispatcher = new EventDispatcher();

$this->pos = PosFactory::createPosGateway($account, $config, $this->eventDispatcher);
$this->pos->setTestMode(true);

$this->card = CreditCardFactory::createForGateway(
$this->pos,
Expand Down
3 changes: 0 additions & 3 deletions tests/Functional/ToslaPosTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ class ToslaPosTest extends TestCase
/** @var ToslaPos */
private PosInterface $pos;

private array $lastResponse;

protected function setUp(): void
{
parent::setUp();
Expand All @@ -45,7 +43,6 @@ protected function setUp(): void
$this->eventDispatcher = new EventDispatcher();

$this->pos = PosFactory::createPosGateway($account, $config, $this->eventDispatcher);
$this->pos->setTestMode(true);

$this->card = CreditCardFactory::createForGateway(
$this->pos,
Expand Down

0 comments on commit 5b2313a

Please sign in to comment.