first commit

This commit is contained in:
2025-03-12 17:06:23 +01:00
commit 2241f7131f
13185 changed files with 1692479 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
<?php
namespace Paynow\Tests\Util;
use Paynow\Tests\TestCase;
use Paynow\Util\SignatureCalculator;
class SignatureCalculatorTest extends TestCase
{
public function testNotValidSuccessfully()
{
// given + when
$signatureCalculator = new SignatureCalculator('InvalidSecretKey', ['key' => 'value']);
// then
$this->assertNotEquals('hash', $signatureCalculator->getHash());
}
public function testShouldValidSuccessfully()
{
// given + when
$signatureCalculator = new SignatureCalculator(
'a621a1fb-b4d8-48ba-a6a3-2a28ed61f605',
[
'key1' => 'value1',
'key2' => 'val/ue2',
]
);
// then
$this->assertEquals('bqD6spGJwPABe58i+mbqsYoF/JLUDR58yqxRqrb0AR0=', $signatureCalculator->getHash());
}
public function testExceptionForEmptyData()
{
// given
$this->expectException(\InvalidArgumentException::class);
// when
$signatureCalculator = new SignatureCalculator('a621a1fb-b4d8-48ba-a6a3-2a28ed61f605', []);
// then
}
}