Skip to content

Commit

Permalink
feat(sc-6805): add phpunit-polyfills to support PHP 8 (#35)
Browse files Browse the repository at this point in the history
Signed-off-by: Ash Wu <hsatac@gmail.com>
  • Loading branch information
hSATAC authored Oct 21, 2022
1 parent 7c2d6bd commit ffb1e12
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ integration-test: guard-SMARTPAY_SECRET_KEY guard-SMARTPAY_PUBLIC_KEY guard-API_
test: guard-SMARTPAY_SECRET_KEY guard-SMARTPAY_PUBLIC_KEY guard-API_BASE
XDEBUG_MODE=coverage vendor/bin/phpunit tests --testdox --coverage-text --whitelist src/

clean-composer:
rm -rf composer.lock vendor

guard-%: GUARD
@ if [ -z '${${*}}' ]; then echo 'Environment variable $* not set.' && exit 1; fi
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
"caseyamcl/guzzle_retry_middleware": "^2.2"
},
"require-dev": {
"phpunit/phpunit": "^5.7",
"phpunit/phpunit": ">= 5.7",
"squizlabs/php_codesniffer": "^3.3",
"friendsofphp/php-cs-fixer": "2.17.1"
"friendsofphp/php-cs-fixer": ">= 2.19.3",
"yoast/phpunit-polyfills": "^1.0"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion tests/Integrations/OrderLifeCycleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

use GuzzleHttp\Client as GuzzleClient;

final class OrderLifecycleTest extends TestCase
final class OrderLifeCycleTest extends TestCase
{
public function testOrderLifecycle()
{
Expand Down
6 changes: 3 additions & 3 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

use Smartpay\Smartpay;

abstract class TestCase extends \PHPUnit\Framework\TestCase
abstract class TestCase extends \Yoast\PHPUnitPolyfills\TestCases\TestCase
{
public function setUp()
public function set_up()
{
Smartpay::reset();

Expand All @@ -22,7 +22,7 @@ public function setUp()
}
}

public function tearDown()
public function tear_down()
{
Smartpay::reset();
}
Expand Down

0 comments on commit ffb1e12

Please sign in to comment.