Skip to content

Commit

Permalink
Try switching to phpunit-polyfills (#4966)
Browse files Browse the repository at this point in the history
* Try switching to phpunit-polyfills

* Extend from polyfills TestCase

* Didn't save one

* Upgrade phpunit before testing. Also test on PHP 8.

* Add ReturnTypeWillChange

* ReturnTypeWillChange is no good here; use the yoast polyfills snake_case methods instead.

* Missed one.

* Avoid infinite loop

* Argh typo

* Only update phpunit version if php version >= 8

* For some reason, Circle is not getting a status code 1 from test failures from unish.sh. Works locally. Let's try calling phpunit directly.

* Add explicit assertions for the benefit of phpunit 9

* Convert from assertFileNotExists to assertFileDoesNotExist

* Convert from assertNotContains to assertStringNotContainsString

* Extend \PHPUnit\Framework\AssertionFailedError instea of \PHPUnit_Framework_AssertionFailedError

* Fixed assertion that was asserting the wrong value

* Some assertion updates that were not saved and committed earlier

* Fix testUpdateStatusDrush to work with php 8

* Fix loadHTMLFile for php 8

* Update to annotated-command 2.12.2

* Update assertRegExp to assertMatchesRegularExpression

* Defensively guard columns access in logger for php 8

* Must use set_up, not constructor in phpunit tests

* More misc phpunit-9 fixes

* More test cleanup

* Put in a test that always fails to see how many of the test scenarios in CircleCI are marked as failures.

* Guard "defines" with if statements in preflight.inc.

* More defensive defines / shutdown handler guard.

* Revert "Put in a test that always fails to see how many of the test scenarios in CircleCI are marked as failures."

This reverts commit 8762b13.
  • Loading branch information
greg-1-anderson committed Jan 3, 2022
1 parent 85eea99 commit 21762cc
Show file tree
Hide file tree
Showing 49 changed files with 696 additions and 331 deletions.
9 changes: 7 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ defaults: &defaults
version: 2.1

executors:
linux80:
docker:
- image: circleci/php:8.0-apache-node
- image: circleci/mysql:5.7.31
linux74:
docker:
- image: circleci/php:7.4-apache-node
Expand Down Expand Up @@ -56,7 +60,8 @@ jobs:
- checkout
- prepare_php
- run: composer install --prefer-dist --no-interaction
- run: ./unish.sh
- run: if [[ -n "$(php --version | grep 'PHP 8')" ]] ; then composer config --unset platform.php && composer remove --dev --no-update symfony/var-dumper && composer update symfony/var-dumper phpunit/phpunit --with-dependencies ; fi
- run: vendor/bin/phpunit --configuration tests

workflows:
build_test:
Expand All @@ -65,7 +70,7 @@ workflows:
- test:
matrix:
parameters:
os: [linux74, linux56]
os: [linux80, linux74, linux56]
drupal: ["9.3.0","9.1.15", "7"]
exclude:
- os: linux56
Expand Down
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@
"symfony/event-dispatcher": "~2.7",
"symfony/finder": "~2.7",
"symfony/yaml": "~2.3",
"phpunit/phpunit": "4.*",
"symfony/process": "2.7.*"
"symfony/process": "2.7.*",
"phpunit/phpunit": "^4 || ^7.5.20 || ^9",
"squizlabs/php_codesniffer": "^3",
"yoast/phpunit-polyfills": "^1"
},
"suggest": {
"ext-pcntl": "*",
Expand Down

0 comments on commit 21762cc

Please sign in to comment.