From 1cf46254b7fb5f51ca973bdbd450ca14e17e321c Mon Sep 17 00:00:00 2001 From: marcusquinn <6428977+marcusquinn@users.noreply.github.com> Date: Fri, 18 Apr 2025 17:42:18 +0100 Subject: [PATCH] Fix: Update test workflow for PHP 7.0 compatibility --- .github/workflows/tests.yml | 6 +----- composer.json | 6 ++++-- includes/core.php | 30 ++++++++++++++++++++++++++++++ tests/bootstrap.php | 4 +--- tests/test-admin.php | 8 +++----- tests/test-core.php | 8 +++----- 6 files changed, 42 insertions(+), 20 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3110cc4..ec138a5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -30,12 +30,8 @@ jobs: run: | if [[ "${{ matrix.php-versions }}" == "7.0" ]]; then composer require --dev phpunit/phpunit:"^6.5" --update-with-dependencies - composer require --dev 10up/wp_mock:"^0.4.2" --update-with-dependencies - composer require --dev antecedent/patchwork:"^2.1.21" --update-with-dependencies - else - composer install --prefer-dist --no-progress - composer require --dev 10up/wp_mock:"^0.4.2" --update-with-dependencies fi + composer install --prefer-dist --no-progress - name: Run tests run: ./vendor/bin/phpunit diff --git a/composer.json b/composer.json index 14bad69..71b8af6 100644 --- a/composer.json +++ b/composer.json @@ -14,10 +14,12 @@ "php": ">=7.0" }, "require-dev": { - "phpunit/phpunit": "^7.5 || ^8.0 || ^9.0", + "phpunit/phpunit": "^6.5 || ^7.5 || ^8.0 || ^9.0", "squizlabs/php_codesniffer": "^3.5", "wp-coding-standards/wpcs": "^2.3", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0" + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "10up/wp_mock": "0.3.0", + "antecedent/patchwork": "^2.1.21" }, "autoload": { "psr-4": { diff --git a/includes/core.php b/includes/core.php index b3d9bbc..d46d45c 100644 --- a/includes/core.php +++ b/includes/core.php @@ -1 +1,31 @@