Files
grzanieplus.pl/plugins/stPayNowPlugin/vendor/pay-now/paynow-php-sdk/tests/TestCase.php
2025-03-12 17:06:23 +01:00

37 lines
925 B
PHP

<?php
namespace Paynow\Tests;
use Paynow\Client;
use Paynow\Environment;
use PHPUnit\Framework\TestCase as BaseTestCase;
class TestCase extends BaseTestCase
{
protected $testHttpClient;
protected $client;
public function __construct($name = null, array $data = [], $dataName = '')
{
$this->client = new Client(
'TestApiKey',
'TestSignatureKey',
Environment::SANDBOX,
'PHPUnitTests'
);
$this->testHttpClient = new TestHttpClient($this->client->getConfiguration());
parent::__construct($name, $data, $dataName);
}
public function loadData($fileName, $asString = false)
{
$filePath = dirname(__FILE__).'/resources/'.$fileName;
if (! $asString) {
return json_decode(file_get_contents($filePath), true);
} else {
return file_get_contents($filePath);
}
}
}