-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from makstech/php_8_support
PHP 8 support
- Loading branch information
Showing
15 changed files
with
347 additions
and
399 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,14 @@ | ||
language: php | ||
|
||
dist: trusty | ||
|
||
php: | ||
- 7.1 | ||
- 7.2 | ||
- 7.3 | ||
- 7.4 | ||
|
||
env: | ||
- HTTPMOCK_VERSION="^0.13.0" | ||
|
||
matrix: | ||
include: | ||
- php: 5.5 | ||
env: HTTPMOCK_VERSION="0.10.1" | ||
- php: 5.6 | ||
env: HTTPMOCK_VERSION="0.10.1" | ||
- php: 7.0 | ||
env: HTTPMOCK_VERSION="0.10.1" | ||
- 8.0 | ||
- 8.1.0 | ||
|
||
before_script: | ||
- composer self-update | ||
- composer require "internations/http-mock:${HTTPMOCK_VERSION}" --no-update | ||
- composer install | ||
|
||
script: php vendor/bin/phpunit test/specs/. | ||
script: composer tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<phpunit bootstrap = "vendor/autoload.php" | ||
backupGlobals = "false" | ||
backupStaticAttributes = "false" | ||
colors = "true" | ||
convertErrorsToExceptions = "true" | ||
convertNoticesToExceptions = "true" | ||
convertWarningsToExceptions = "true" | ||
processIsolation = "false" | ||
stopOnFailure = "false"> | ||
|
||
<testsuites> | ||
<testsuite name="taxjar-php"> | ||
<directory>test</directory> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
<?php | ||
require 'vendor/autoload.php'; | ||
|
||
class TaxJarTest extends PHPUnit_Framework_TestCase | ||
namespace TaxJar\Tests; | ||
|
||
use GuzzleHttp\Handler\MockHandler; | ||
use GuzzleHttp\HandlerStack; | ||
use GuzzleHttp\Middleware; | ||
use PHPUnit\Framework\TestCase; | ||
use TaxJar\Client; | ||
|
||
abstract class TaxJarTest extends TestCase | ||
{ | ||
protected $client; | ||
protected $history = []; | ||
|
||
use \InterNations\Component\HttpMock\PHPUnit\HttpMockTrait; | ||
/** @var MockHandler */ | ||
protected $http; | ||
|
||
public static function setUpBeforeClass() | ||
{ | ||
static::setUpHttpMockBeforeClass('8082', 'localhost'); | ||
} | ||
/** @var Client */ | ||
protected $client; | ||
|
||
public static function tearDownAfterClass() | ||
public function setUp(): void | ||
{ | ||
static::tearDownHttpMockAfterClass(); | ||
} | ||
$this->http = new MockHandler(); | ||
$handler = HandlerStack::create($this->http); | ||
$handler->push(Middleware::history($this->history)); | ||
|
||
public function setUp() | ||
{ | ||
$this->setUpHttpMock(); | ||
$this->client = TaxJar\Client::withApiKey('test'); | ||
$this->client = Client::withApiKey('test'); | ||
$this->client->setApiConfig('handler', $handler); | ||
$this->client->setApiConfig('base_uri', 'http://localhost:8082'); | ||
} | ||
|
||
public function tearDown() | ||
{ | ||
$this->tearDownHttpMock(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.