first commit
This commit is contained in:
36
plugins/stPayNowPlugin/vendor/pay-now/paynow-php-sdk/tests/TestCase.php
vendored
Normal file
36
plugins/stPayNowPlugin/vendor/pay-now/paynow-php-sdk/tests/TestCase.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user