Skip to content

Commit

Permalink
Merge pull request #235 from mewebstudio/working-on-test-coverage
Browse files Browse the repository at this point in the history
Working on test coverage
  • Loading branch information
nuryagdym authored Sep 27, 2024
2 parents 11d97a2 + 387c379 commit edec873
Show file tree
Hide file tree
Showing 28 changed files with 734 additions and 310 deletions.
5 changes: 3 additions & 2 deletions tests/Unit/Crypt/AkbankPosCryptTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use Mews\Pos\PosInterface;
use Mews\Pos\Tests\Unit\DataMapper\ResponseDataMapper\AkbankPosResponseDataMapperTest;
use PHPUnit\Framework\TestCase;
use Psr\Log\NullLogger;
use Psr\Log\LoggerInterface;

/**
* @covers \Mews\Pos\Crypt\AkbankPosCrypt
Expand All @@ -38,7 +38,8 @@ protected function setUp(): void
'sub-2023090417500272654BD9A49CF07574'
);

$this->crypt = new AkbankPosCrypt(new NullLogger());
$logger = $this->createMock(LoggerInterface::class);
$this->crypt = new AkbankPosCrypt($logger);
}

public function testGenerateRandomString(): void
Expand Down
6 changes: 4 additions & 2 deletions tests/Unit/Crypt/EstPosCryptTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
use Mews\Pos\Factory\AccountFactory;
use Mews\Pos\PosInterface;
use PHPUnit\Framework\TestCase;
use Psr\Log\NullLogger;
use Psr\Log\LoggerInterface;

/**
* @covers \Mews\Pos\Crypt\EstPosCrypt
* @covers \Mews\Pos\Crypt\AbstractCrypt
*/
class EstPosCryptTest extends TestCase
{
Expand All @@ -34,7 +35,8 @@ protected function setUp(): void
'TRPS0200'
);

$this->crypt = new EstPosCrypt(new NullLogger());
$logger = $this->createMock(LoggerInterface::class);
$this->crypt = new EstPosCrypt($logger);
}

public function testCreate3DHash(): void
Expand Down
9 changes: 7 additions & 2 deletions tests/Unit/Crypt/EstV3PosCryptTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php
/**
* @license MIT
*/

namespace Mews\Pos\Tests\Unit\Crypt;

Expand All @@ -7,10 +10,11 @@
use Mews\Pos\Factory\AccountFactory;
use Mews\Pos\PosInterface;
use PHPUnit\Framework\TestCase;
use Psr\Log\NullLogger;
use Psr\Log\LoggerInterface;

/**
* @covers \Mews\Pos\Crypt\EstV3PosCrypt
* @covers \Mews\Pos\Crypt\AbstractCrypt
*/
class EstV3PosCryptTest extends TestCase
{
Expand All @@ -31,7 +35,8 @@ protected function setUp(): void
'123456'
);

$this->crypt = new EstV3PosCrypt(new NullLogger());
$logger = $this->createMock(LoggerInterface::class);
$this->crypt = new EstV3PosCrypt($logger);
}

/**
Expand Down
6 changes: 4 additions & 2 deletions tests/Unit/Crypt/GarantiPosCryptTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
use Mews\Pos\Factory\AccountFactory;
use Mews\Pos\PosInterface;
use PHPUnit\Framework\TestCase;
use Psr\Log\NullLogger;
use Psr\Log\LoggerInterface;

/**
* @covers \Mews\Pos\Crypt\GarantiPosCrypt
* @covers \Mews\Pos\Crypt\AbstractCrypt
*/
class GarantiPosCryptTest extends TestCase
{
Expand All @@ -37,7 +38,8 @@ protected function setUp(): void
'123qweASD/'
);

$this->crypt = new GarantiPosCrypt(new NullLogger());
$logger = $this->createMock(LoggerInterface::class);
$this->crypt = new GarantiPosCrypt($logger);
}

/**
Expand Down
5 changes: 3 additions & 2 deletions tests/Unit/Crypt/InterPosCryptTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Mews\Pos\Factory\AccountFactory;
use Mews\Pos\PosInterface;
use PHPUnit\Framework\TestCase;
use Psr\Log\NullLogger;
use Psr\Log\LoggerInterface;

/**
* @covers \Mews\Pos\Crypt\InterPosCrypt
Expand Down Expand Up @@ -42,7 +42,8 @@ protected function setUp(): void
$merchantPass
);

$this->crypt = new InterPosCrypt(new NullLogger());
$logger = $this->createMock(LoggerInterface::class);
$this->crypt = new InterPosCrypt($logger);
}

/**
Expand Down
6 changes: 4 additions & 2 deletions tests/Unit/Crypt/KuveytPosCryptTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
use Mews\Pos\Exceptions\NotImplementedException;
use Mews\Pos\Factory\AccountFactory;
use PHPUnit\Framework\TestCase;
use Psr\Log\NullLogger;
use Psr\Log\LoggerInterface;

/**
* @covers \Mews\Pos\Crypt\KuveytPosCrypt
* @covers \Mews\Pos\Crypt\AbstractCrypt
*/
class KuveytPosCryptTest extends TestCase
{
Expand All @@ -34,7 +35,8 @@ protected function setUp(): void
'Api123'
);

$this->crypt = new KuveytPosCrypt(new NullLogger());
$logger = $this->createMock(LoggerInterface::class);
$this->crypt = new KuveytPosCrypt($logger);
}

public function testHashString(): void
Expand Down
5 changes: 3 additions & 2 deletions tests/Unit/Crypt/PayFlexCP4CryptTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Mews\Pos\Factory\AccountFactory;
use Mews\Pos\PosInterface;
use PHPUnit\Framework\TestCase;
use Psr\Log\NullLogger;
use Psr\Log\LoggerInterface;

/**
* @covers \Mews\Pos\Crypt\PayFlexCPV4Crypt
Expand All @@ -35,7 +35,8 @@ protected function setUp(): void
PosInterface::MODEL_3D_SECURE
);

$this->crypt = new PayFlexCPV4Crypt(new NullLogger());
$logger = $this->createMock(LoggerInterface::class);
$this->crypt = new PayFlexCPV4Crypt($logger);
}


Expand Down
6 changes: 4 additions & 2 deletions tests/Unit/Crypt/PayForPosCryptTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
use Mews\Pos\Factory\AccountFactory;
use Mews\Pos\PosInterface;
use PHPUnit\Framework\TestCase;
use Psr\Log\NullLogger;
use Psr\Log\LoggerInterface;

/**
* @covers \Mews\Pos\Crypt\PayForPosCrypt
* @covers \Mews\Pos\Crypt\AbstractCrypt
*/
class PayForPosCryptTest extends TestCase
{
Expand All @@ -33,7 +34,8 @@ protected function setUp(): void
'12345678'
);

$this->crypt = new PayForPosCrypt(new NullLogger());
$logger = $this->createMock(LoggerInterface::class);
$this->crypt = new PayForPosCrypt($logger);
}


Expand Down
6 changes: 4 additions & 2 deletions tests/Unit/Crypt/PosNetCryptTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
use Mews\Pos\Factory\AccountFactory;
use Mews\Pos\PosInterface;
use PHPUnit\Framework\TestCase;
use Psr\Log\NullLogger;
use Psr\Log\LoggerInterface;

/**
* @covers \Mews\Pos\Crypt\PosNetCrypt
* @covers \Mews\Pos\Crypt\AbstractCrypt
*/
class PosNetCryptTest extends TestCase
{
Expand All @@ -33,7 +34,8 @@ protected function setUp(): void
'10,10,10,10,10,10,10,10'
);

$this->crypt = new PosNetCrypt(new NullLogger());
$logger = $this->createMock(LoggerInterface::class);
$this->crypt = new PosNetCrypt($logger);
}


Expand Down
5 changes: 3 additions & 2 deletions tests/Unit/Crypt/PosNetV1PosCryptTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Mews\Pos\Factory\AccountFactory;
use Mews\Pos\PosInterface;
use PHPUnit\Framework\TestCase;
use Psr\Log\NullLogger;
use Psr\Log\LoggerInterface;

/**
* @covers \Mews\Pos\Crypt\PosNetV1PosCrypt
Expand All @@ -34,7 +34,8 @@ protected function setUp(): void
'10,10,10,10,10,10,10,10'
);

$this->crypt = new PosNetV1PosCrypt(new NullLogger());
$logger = $this->createMock(LoggerInterface::class);
$this->crypt = new PosNetV1PosCrypt($logger);
}

/**
Expand Down
6 changes: 4 additions & 2 deletions tests/Unit/Crypt/ToslaPosCryptTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
use Mews\Pos\Entity\Account\ToslaPosAccount;
use Mews\Pos\Factory\AccountFactory;
use PHPUnit\Framework\TestCase;
use Psr\Log\NullLogger;
use Psr\Log\LoggerInterface;

/**
* @covers \Mews\Pos\Crypt\ToslaPosCrypt
* @covers \Mews\Pos\Crypt\AbstractCrypt
*/
class ToslaPosCryptTest extends TestCase
{
Expand All @@ -31,7 +32,8 @@ protected function setUp(): void
'POS_ENT_Test_001!*!*',
);

$this->crypt = new ToslaPosCrypt(new NullLogger());
$logger = $this->createMock(LoggerInterface::class);
$this->crypt = new ToslaPosCrypt($logger);
}

public function testCreate3DHash(): void
Expand Down
Loading

0 comments on commit edec873

Please sign in to comment.