diff --git a/.travis.yml b/.travis.yml index a22d24e..44589ab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,11 @@ language: php +dist: bionic + php: - 7.4 - 8.0 - - nightly + - 8.1.0 matrix: allow_failures: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 280e637..bc8b8cc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,7 +22,7 @@ These are run offline at the developers request. The purpose of these tests is t > Update details accordingly -`tests/create-test-db.sh` +`tests/Integration/create-test-db.sh` ### Running the tests diff --git a/composer.json b/composer.json index 4fcb513..5d802dc 100644 --- a/composer.json +++ b/composer.json @@ -14,14 +14,14 @@ } }, "require": { - "php": "^7.4 || ^8.0", + "php": "^7.4 || ^8.0 || ^8.1", "cache/array-adapter": "^1.1", "doctrine/annotations": "^1.13" }, "require-dev": { "phpunit/phpunit": "^7 || ^9", "roots/wordpress": "^5.8", - "symfony/dotenv": "^5.3", + "symfony/dotenv": "^5.3 || ^6.0", "wp-phpunit/wp-phpunit": "^5.8", "yoast/phpunit-polyfills": "^1.0" }, @@ -38,7 +38,8 @@ "test:coverage": "php -dxdebug.mode=coverage bin/phpunit --coverage-clover='./clover.xml'", "test:integration": "vendor/bin/phpunit --testsuite integration", "php-cs-fixer:test": "tools/php-cs-fixer/vendor/bin/php-cs-fixer fix -v --diff --dry-run", - "php-cs-fixer:fix": "tools/php-cs-fixer/vendor/bin/php-cs-fixer fix -v --diff" + "php-cs-fixer:fix": "tools/php-cs-fixer/vendor/bin/php-cs-fixer fix -v --diff", + "install-tools": "@composer install --working-dir=tools/php-cs-fixer" }, "extra": { "wordpress-install-dir": "tests/integration/wp" diff --git a/tests/Integration/HooksIntegrationTest.php b/tests/Integration/HooksIntegrationTest.php index abf5783..0cf21c2 100644 --- a/tests/Integration/HooksIntegrationTest.php +++ b/tests/Integration/HooksIntegrationTest.php @@ -2,14 +2,17 @@ declare(strict_types=1); +namespace BoxUk\WpHookAttributes\Tests\Integration; + use BoxUk\WpHookAttributes\WordPressHookAttributes; +use WP_UnitTestCase; /** * @group integration */ class HooksIntegrationTest extends WP_UnitTestCase { - public function setUp() + public function setUp(): void { // Makes the tests much faster. tests_add_filter('wp_hook_attributes_registered_namespaces', function () { diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 3007218..f6141d3 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -15,7 +15,8 @@ if ($is_integration) { if (is_readable(__DIR__ . '/integration/.env')) { - $dotenv = new Dotenv(true); + $dotenv = new Dotenv(); + $dotenv->usePutenv(true); $dotenv->load(__DIR__ . '/integration/.env'); }