From a4470836232f0b268ec531e9215cfa94b62ebc6d Mon Sep 17 00:00:00 2001 From: bkrukowski Date: Mon, 25 Jul 2022 21:05:55 +0400 Subject: [PATCH 01/24] Setup GitHub Actions for v3.0 --- .gitattributes | 2 +- .github/workflows/tests.yml | 54 ++++++++++++++++++++++++++++++++++ .travis.yml | 58 ------------------------------------- LICENSE | 2 +- composer.json | 2 +- 5 files changed, 57 insertions(+), 61 deletions(-) create mode 100644 .github/workflows/tests.yml delete mode 100644 .travis.yml diff --git a/.gitattributes b/.gitattributes index 8e184d6..4af4a0c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,4 @@ +/.github export-ignore /bin export-ignore /dev-tools export-ignore /tests export-ignore @@ -5,5 +6,4 @@ /.gitattributes export-ignore /.gitignore export-ignore /.php_cs.dist export-ignore -/.travis.yml export-ignore /phpunit.xml.dist export-ignore diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..8d1181b --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,54 @@ +name: 'Tests' +on: + push: + tags: + - v* + branches: + - '**' + pull_request: + +jobs: + run: + runs-on: ${{ matrix.operating-system }} + strategy: + matrix: + operating-system: ['ubuntu-20.04'] + php-versions: ['5.3', '5.4', '5.5', '5.6', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] + steps: + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + coverage: xdebug + env: + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Checkout + uses: actions/checkout@v2 + + - name: Install dependencies + uses: php-actions/composer@v6 + with: + php_version: ${{ matrix.php-versions }} + version: 1 + + - name: Install dev-tools + if: startsWith(matrix.php-versions, '7.') + uses: php-actions/composer@v6 + with: + php_version: ${{ matrix.php-versions }} + args: --working-dir=dev-tools + version: 1 + + - name: Tests + run: vendor/bin/phpunit-4.8-fixer && vendor/bin/phpunit + + - name: Coding Standards Fixer + if: startsWith(matrix.php-versions, '7.') + run: ./dev-tools/vendor/bin/php-cs-fixer --diff --dry-run -v --allow-risky=yes fix && ./dev-tools/vendor/bin/php-cs-fixer --diff --dry-run -v --allow-risky=yes fix .php_cs.dist + + - name: Coverage + if: startsWith(matrix.php-versions, '7.') + run: bin/coveralls.sh + env: + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 17a5ea9..0000000 --- a/.travis.yml +++ /dev/null @@ -1,58 +0,0 @@ -language: php - -dist: trusty -sudo: false - -php: - - nightly - - 7.4 - - 7.3 - - 7.2 - - 7.1 - - 7.0 - - 5.6 - - 5.5 - - 5.4 - -env: - - COMPOSER_MEMORY_LIMIT=-1 - -matrix: - include: - - php: 5.3 - dist: precise - - allow_failures: - - php: nightly - -install: - - PHP_VER=$(php -r "echo PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION . '.' . PHP_RELEASE_VERSION;") - - travis_retry composer update - - | - if [[ ${PHP_VER:0:3} != "8.0" ]]; then - cd dev-tools; travis_retry composer update; cd ..; - fi - - | - if [[ ${PHP_VER:0:3} == "7.1" ]]; then - cd dev-tools; - travis_retry composer require friendsofphp/php-cs-fixer:v2.16.1; - cd ..; - export RUN_CS_FIXER="true"; - fi - -before_script: - - vendor/bin/phpunit-4.8-fixer - - composer show - -script: - - | - if [[ "$RUN_CS_FIXER" == "true" ]]; then - ./dev-tools/vendor/bin/php-cs-fixer --diff --dry-run -v --allow-risky=yes fix && ./dev-tools/vendor/bin/php-cs-fixer --diff --dry-run -v --allow-risky=yes fix .php_cs.dist; - fi - - vendor/bin/phpunit - -after_script: - - | - if [[ ${PHP_VER:0:3} != "8.0" ]]; then - travis_retry bin/coveralls.sh; - fi diff --git a/LICENSE b/LICENSE index 6f63efa..ccd9685 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2019-2020 Bartłomiej Krukowski +Copyright (c) 2019-2022 Bartłomiej Krukowski Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/composer.json b/composer.json index 36cfbd0..3e8995b 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "keywords": ["golang", "defer"], "type": "library", "require": { - "php": ">=5.3" + "php": "^5.3 || ^7.0 || ^8.0" }, "require-dev": { "awesomite/phpunit-4.8-fixer": "^1.0", From 8e9c42148881d7f8c35be946e3b98d466ee98559 Mon Sep 17 00:00:00 2001 From: bkrukowski Date: Mon, 25 Jul 2022 21:20:24 +0400 Subject: [PATCH 02/24] Setup GitHub Actions for v3.0 --- .github/workflows/tests.yml | 6 +++--- dev-tools/composer.json | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8d1181b..8f05ad5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,7 +33,7 @@ jobs: version: 1 - name: Install dev-tools - if: startsWith(matrix.php-versions, '7.') + if: startsWith(matrix.php-versions, '5.6') || startsWith(matrix.php-versions, '7.') || startsWith(matrix.php-versions, '8.') uses: php-actions/composer@v6 with: php_version: ${{ matrix.php-versions }} @@ -44,11 +44,11 @@ jobs: run: vendor/bin/phpunit-4.8-fixer && vendor/bin/phpunit - name: Coding Standards Fixer - if: startsWith(matrix.php-versions, '7.') + if: startsWith(matrix.php-versions, '5.6') || startsWith(matrix.php-versions, '7.') || startsWith(matrix.php-versions, '8.') run: ./dev-tools/vendor/bin/php-cs-fixer --diff --dry-run -v --allow-risky=yes fix && ./dev-tools/vendor/bin/php-cs-fixer --diff --dry-run -v --allow-risky=yes fix .php_cs.dist - name: Coverage - if: startsWith(matrix.php-versions, '7.') + if: startsWith(matrix.php-versions, '5.6') || startsWith(matrix.php-versions, '7.') || startsWith(matrix.php-versions, '8.') run: bin/coveralls.sh env: COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/dev-tools/composer.json b/dev-tools/composer.json index 908245a..8f770bd 100644 --- a/dev-tools/composer.json +++ b/dev-tools/composer.json @@ -1,5 +1,6 @@ { "require": { - "php-coveralls/php-coveralls": "^1.1 || ^2.1" + "friendsofphp/php-cs-fixer": "^2.19.3", + "php-coveralls/php-coveralls": "^2.5" } } From dc9c17ca234e375456b3e885c386797c589d9525 Mon Sep 17 00:00:00 2001 From: bkrukowski Date: Mon, 25 Jul 2022 21:29:19 +0400 Subject: [PATCH 03/24] Setup GitHub Actions for v3.0 --- .github/workflows/tests.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8f05ad5..94a2902 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -26,6 +26,13 @@ jobs: - name: Checkout uses: actions/checkout@v2 + - name: Setup composer.json + uses: php-actions/composer@v6 + with: + command: composer config platform.php ${{ matrix.php-versions }} + php_version: ${{ matrix.php-versions }} + version: 1 + - name: Install dependencies uses: php-actions/composer@v6 with: From 756546d8c3b47eb01bac91c1c1fabd99222d691d Mon Sep 17 00:00:00 2001 From: bkrukowski Date: Mon, 25 Jul 2022 21:30:49 +0400 Subject: [PATCH 04/24] Setup GitHub Actions for v3.0 --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 94a2902..1f84b10 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,13 +31,13 @@ jobs: with: command: composer config platform.php ${{ matrix.php-versions }} php_version: ${{ matrix.php-versions }} - version: 1 + version: 8.1 - name: Install dependencies uses: php-actions/composer@v6 with: php_version: ${{ matrix.php-versions }} - version: 1 + version: 8.1 - name: Install dev-tools if: startsWith(matrix.php-versions, '5.6') || startsWith(matrix.php-versions, '7.') || startsWith(matrix.php-versions, '8.') From 55cac4a8a79c0dcda47671e0d73fab1986d55138 Mon Sep 17 00:00:00 2001 From: bkrukowski Date: Mon, 25 Jul 2022 21:32:47 +0400 Subject: [PATCH 05/24] Setup GitHub Actions for v3.0 --- .github/workflows/tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1f84b10..91c406e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -30,14 +30,14 @@ jobs: uses: php-actions/composer@v6 with: command: composer config platform.php ${{ matrix.php-versions }} - php_version: ${{ matrix.php-versions }} - version: 8.1 + php_version: 8.1 + version: 1 - name: Install dependencies uses: php-actions/composer@v6 with: - php_version: ${{ matrix.php-versions }} - version: 8.1 + php_version: 8.1 + version: 1 - name: Install dev-tools if: startsWith(matrix.php-versions, '5.6') || startsWith(matrix.php-versions, '7.') || startsWith(matrix.php-versions, '8.') From d60d58b9ae126deb547531d38714c691761f955d Mon Sep 17 00:00:00 2001 From: bkrukowski Date: Mon, 25 Jul 2022 21:35:02 +0400 Subject: [PATCH 06/24] Setup GitHub Actions for v3.0 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 91c406e..7e99f63 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -29,7 +29,7 @@ jobs: - name: Setup composer.json uses: php-actions/composer@v6 with: - command: composer config platform.php ${{ matrix.php-versions }} + command: config platform.php ${{ matrix.php-versions }} php_version: 8.1 version: 1 From 0faa56ae07201b0559b2a16328c31030645d6197 Mon Sep 17 00:00:00 2001 From: bkrukowski Date: Mon, 25 Jul 2022 21:37:30 +0400 Subject: [PATCH 07/24] Setup GitHub Actions for v3.0 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7e99f63..1491201 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -29,7 +29,7 @@ jobs: - name: Setup composer.json uses: php-actions/composer@v6 with: - command: config platform.php ${{ matrix.php-versions }} + command: config platform.php ${{ matrix.php-versions }}.99 php_version: 8.1 version: 1 From f93c22238121c319b04de7c9b55573b53e8c94c0 Mon Sep 17 00:00:00 2001 From: bkrukowski Date: Mon, 25 Jul 2022 21:38:29 +0400 Subject: [PATCH 08/24] Setup GitHub Actions for v3.0 --- .github/workflows/tests.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1491201..558c805 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,6 +39,14 @@ jobs: php_version: 8.1 version: 1 + - name: Setup dev-tools/composer.json + if: startsWith(matrix.php-versions, '5.6') || startsWith(matrix.php-versions, '7.') || startsWith(matrix.php-versions, '8.') + uses: php-actions/composer@v6 + with: + command: config platform.php ${{ matrix.php-versions }}.99 + php_version: 8.1 + version: 1 + - name: Install dev-tools if: startsWith(matrix.php-versions, '5.6') || startsWith(matrix.php-versions, '7.') || startsWith(matrix.php-versions, '8.') uses: php-actions/composer@v6 From 7a58439153970ddb4d78787e02d68276947324ee Mon Sep 17 00:00:00 2001 From: bkrukowski Date: Mon, 25 Jul 2022 21:41:02 +0400 Subject: [PATCH 09/24] Setup GitHub Actions for v3.0 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 558c805..4397e0a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -56,7 +56,7 @@ jobs: version: 1 - name: Tests - run: vendor/bin/phpunit-4.8-fixer && vendor/bin/phpunit + run: sudo vendor/bin/phpunit-4.8-fixer && vendor/bin/phpunit - name: Coding Standards Fixer if: startsWith(matrix.php-versions, '5.6') || startsWith(matrix.php-versions, '7.') || startsWith(matrix.php-versions, '8.') From c5f8b3f0d3c9d4df4715e913cb7a764bfd85659e Mon Sep 17 00:00:00 2001 From: bkrukowski Date: Mon, 25 Jul 2022 21:53:30 +0400 Subject: [PATCH 10/24] Setup GitHub Actions for v3.0 --- .github/workflows/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4397e0a..b48accd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,7 +13,8 @@ jobs: strategy: matrix: operating-system: ['ubuntu-20.04'] - php-versions: ['5.3', '5.4', '5.5', '5.6', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] +# php-versions: ['5.3', '5.4', '5.5', '5.6', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] + php-versions: ['8.0'] steps: - name: Setup PHP uses: shivammathur/setup-php@v2 From 5bffc6e5c2fabcada8892173c210ef5907e2d5c5 Mon Sep 17 00:00:00 2001 From: bkrukowski Date: Mon, 25 Jul 2022 22:01:14 +0400 Subject: [PATCH 11/24] Setup GitHub Actions for v3.0 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b48accd..c355ae0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,7 @@ jobs: matrix: operating-system: ['ubuntu-20.04'] # php-versions: ['5.3', '5.4', '5.5', '5.6', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] - php-versions: ['8.0'] + php-versions: ['7.4'] steps: - name: Setup PHP uses: shivammathur/setup-php@v2 From f22e1972d84e3c1007e16c35763a0fdcdc0857bd Mon Sep 17 00:00:00 2001 From: bkrukowski Date: Mon, 25 Jul 2022 22:04:40 +0400 Subject: [PATCH 12/24] Setup GitHub Actions for v3.0 --- dev-tools/composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-tools/composer.json b/dev-tools/composer.json index 8f770bd..224b763 100644 --- a/dev-tools/composer.json +++ b/dev-tools/composer.json @@ -1,6 +1,6 @@ { "require": { - "friendsofphp/php-cs-fixer": "^2.19.3", + "friendsofphp/php-cs-fixer": "2.16.1", "php-coveralls/php-coveralls": "^2.5" } } From a2742bc6d114a1b521ea33e199d4768329164fa8 Mon Sep 17 00:00:00 2001 From: bkrukowski Date: Mon, 25 Jul 2022 22:06:48 +0400 Subject: [PATCH 13/24] Setup GitHub Actions for v3.0 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c355ae0..f6f2348 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,7 @@ jobs: matrix: operating-system: ['ubuntu-20.04'] # php-versions: ['5.3', '5.4', '5.5', '5.6', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] - php-versions: ['7.4'] + php-versions: ['5.3', '5.4', '5.5', '5.6', '7.1', '7.2', '7.3', '7.4'] steps: - name: Setup PHP uses: shivammathur/setup-php@v2 From 97535b3c0b164628caf0b273a5bc5ec483518313 Mon Sep 17 00:00:00 2001 From: bkrukowski Date: Mon, 25 Jul 2022 22:16:30 +0400 Subject: [PATCH 14/24] Setup GitHub Actions for v3.0 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f6f2348..b48accd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,7 @@ jobs: matrix: operating-system: ['ubuntu-20.04'] # php-versions: ['5.3', '5.4', '5.5', '5.6', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] - php-versions: ['5.3', '5.4', '5.5', '5.6', '7.1', '7.2', '7.3', '7.4'] + php-versions: ['8.0'] steps: - name: Setup PHP uses: shivammathur/setup-php@v2 From fbb68aadbb1c8240ba32b3bb0bd71dc109856a46 Mon Sep 17 00:00:00 2001 From: bkrukowski Date: Mon, 25 Jul 2022 22:17:26 +0400 Subject: [PATCH 15/24] Setup GitHub Actions for v3.0 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b48accd..418c750 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: operating-system: ['ubuntu-20.04'] -# php-versions: ['5.3', '5.4', '5.5', '5.6', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] +# php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] php-versions: ['8.0'] steps: - name: Setup PHP From 61ff40b0f0127979302cd392b3b24a2d7c9734e5 Mon Sep 17 00:00:00 2001 From: bkrukowski Date: Mon, 25 Jul 2022 22:18:40 +0400 Subject: [PATCH 16/24] Setup GitHub Actions for v3.0 --- .github/workflows/tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 418c750..fbfb75c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -41,7 +41,7 @@ jobs: version: 1 - name: Setup dev-tools/composer.json - if: startsWith(matrix.php-versions, '5.6') || startsWith(matrix.php-versions, '7.') || startsWith(matrix.php-versions, '8.') + if: startsWith(matrix.php-versions, '5.6') || startsWith(matrix.php-versions, '7.') uses: php-actions/composer@v6 with: command: config platform.php ${{ matrix.php-versions }}.99 @@ -49,7 +49,7 @@ jobs: version: 1 - name: Install dev-tools - if: startsWith(matrix.php-versions, '5.6') || startsWith(matrix.php-versions, '7.') || startsWith(matrix.php-versions, '8.') + if: startsWith(matrix.php-versions, '5.6') || startsWith(matrix.php-versions, '7.') uses: php-actions/composer@v6 with: php_version: ${{ matrix.php-versions }} @@ -60,11 +60,11 @@ jobs: run: sudo vendor/bin/phpunit-4.8-fixer && vendor/bin/phpunit - name: Coding Standards Fixer - if: startsWith(matrix.php-versions, '5.6') || startsWith(matrix.php-versions, '7.') || startsWith(matrix.php-versions, '8.') + if: startsWith(matrix.php-versions, '5.6') || startsWith(matrix.php-versions, '7.') run: ./dev-tools/vendor/bin/php-cs-fixer --diff --dry-run -v --allow-risky=yes fix && ./dev-tools/vendor/bin/php-cs-fixer --diff --dry-run -v --allow-risky=yes fix .php_cs.dist - name: Coverage - if: startsWith(matrix.php-versions, '5.6') || startsWith(matrix.php-versions, '7.') || startsWith(matrix.php-versions, '8.') + if: startsWith(matrix.php-versions, '5.6') || startsWith(matrix.php-versions, '7.') run: bin/coveralls.sh env: COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 295bd37d97bbcf7a2fa13f9aca3e6646dffb622a Mon Sep 17 00:00:00 2001 From: bkrukowski Date: Mon, 25 Jul 2022 22:24:36 +0400 Subject: [PATCH 17/24] Setup GitHub Actions for v3.0 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fbfb75c..39dd7db 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,7 @@ jobs: matrix: operating-system: ['ubuntu-20.04'] # php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] - php-versions: ['8.0'] + php-versions: ['8.1'] steps: - name: Setup PHP uses: shivammathur/setup-php@v2 From 175c671dc072842a1f083b7dd70ca356f784b105 Mon Sep 17 00:00:00 2001 From: bkrukowski Date: Mon, 25 Jul 2022 22:44:15 +0400 Subject: [PATCH 18/24] Setup GitHub Actions for v3.0 --- .github/workflows/tests.yml | 2 +- composer.json | 4 ++-- tests/DeferTest.php | 8 ++++---- tests/TestCase.php | 12 ++++++++++-- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 39dd7db..38468ba 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -57,7 +57,7 @@ jobs: version: 1 - name: Tests - run: sudo vendor/bin/phpunit-4.8-fixer && vendor/bin/phpunit + run: vendor/bin/phpunit - name: Coding Standards Fixer if: startsWith(matrix.php-versions, '5.6') || startsWith(matrix.php-versions, '7.') diff --git a/composer.json b/composer.json index 3e8995b..18904d9 100644 --- a/composer.json +++ b/composer.json @@ -7,8 +7,8 @@ "php": "^5.3 || ^7.0 || ^8.0" }, "require-dev": { - "awesomite/phpunit-4.8-fixer": "^1.0", - "phpunit/phpunit": "4.8.36" + "phpunit/phpunit": "4.8.36 || ^8.5 || ^9.5", + "symfony/phpunit-bridge": "*" }, "license": "MIT", "authors": [ diff --git a/tests/DeferTest.php b/tests/DeferTest.php index 57aee26..2530567 100644 --- a/tests/DeferTest.php +++ b/tests/DeferTest.php @@ -47,8 +47,8 @@ public function testThrowExceptionInDefer() EXPECTED; $this->expectOutputString($expectedOutput); - $this->expectException(\get_class(new DeferException())); - $this->expectExceptionMessage('deferred'); + $this->expectException_(\get_class(new DeferException())); + $this->expectExceptionMessage_('deferred'); defer($_, function () { echo "throwing deferred exception\n"; @@ -93,8 +93,8 @@ public function testUnsetContext() */ public function testInvalidArgumentCallable($notCallable) { - $this->expectException(\get_class(new \InvalidArgumentException())); - $this->expectExceptionMessage('Function defer expects argument $callable of type callable'); + $this->expectException_(\get_class(new \InvalidArgumentException())); + $this->expectExceptionMessage_('Function defer expects argument $callable of type callable'); defer($_, $notCallable); } diff --git a/tests/TestCase.php b/tests/TestCase.php index 4389594..09dc018 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -21,16 +21,24 @@ abstract class TestCase extends BaseTestCase /** * @param string $class */ - public function expectException($class) + public function expectException_($class) { + if (\method_exists($this, 'expectException')) { + $this->expectException($class); + return; + } $this->setProperty('expectedException', $class); } /** * @param string $message */ - public function expectExceptionMessage($message) + public function expectExceptionMessage_($message) { + if (\method_exists($this, 'expectExceptionMessage')) { + $this->expectExceptionMessage($message); + return; + } $this->setProperty('expectedExceptionMessage', $message); } From b5d7fd374af8dd41640d20c492acf59554e85dcd Mon Sep 17 00:00:00 2001 From: bkrukowski Date: Mon, 25 Jul 2022 22:47:00 +0400 Subject: [PATCH 19/24] Setup GitHub Actions for v3.0 --- .github/workflows/tests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 38468ba..6242b70 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,8 +13,7 @@ jobs: strategy: matrix: operating-system: ['ubuntu-20.04'] -# php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] - php-versions: ['8.1'] + php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] steps: - name: Setup PHP uses: shivammathur/setup-php@v2 From b2c63ddc6acffdd0ac7025ae6507684b7d445f38 Mon Sep 17 00:00:00 2001 From: bkrukowski Date: Mon, 25 Jul 2022 22:50:02 +0400 Subject: [PATCH 20/24] Setup GitHub Actions for v3.0 --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6242b70..2c4d742 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -59,11 +59,11 @@ jobs: run: vendor/bin/phpunit - name: Coding Standards Fixer - if: startsWith(matrix.php-versions, '5.6') || startsWith(matrix.php-versions, '7.') + if: startsWith(matrix.php-versions, '7.') run: ./dev-tools/vendor/bin/php-cs-fixer --diff --dry-run -v --allow-risky=yes fix && ./dev-tools/vendor/bin/php-cs-fixer --diff --dry-run -v --allow-risky=yes fix .php_cs.dist - name: Coverage - if: startsWith(matrix.php-versions, '5.6') || startsWith(matrix.php-versions, '7.') + if: startsWith(matrix.php-versions, '5.') || startsWith(matrix.php-versions, '7.') run: bin/coveralls.sh env: COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 96a572b7b68d94b7a9dcab88e533ba890a142a41 Mon Sep 17 00:00:00 2001 From: bkrukowski Date: Mon, 25 Jul 2022 22:52:06 +0400 Subject: [PATCH 21/24] Setup GitHub Actions for v3.0 --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2c4d742..9189835 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -40,7 +40,7 @@ jobs: version: 1 - name: Setup dev-tools/composer.json - if: startsWith(matrix.php-versions, '5.6') || startsWith(matrix.php-versions, '7.') + if: startsWith(matrix.php-versions, '5.') || startsWith(matrix.php-versions, '7.') uses: php-actions/composer@v6 with: command: config platform.php ${{ matrix.php-versions }}.99 @@ -48,7 +48,7 @@ jobs: version: 1 - name: Install dev-tools - if: startsWith(matrix.php-versions, '5.6') || startsWith(matrix.php-versions, '7.') + if: startsWith(matrix.php-versions, '5.') || startsWith(matrix.php-versions, '7.') uses: php-actions/composer@v6 with: php_version: ${{ matrix.php-versions }} From e0ec42bc97efff78f575eeb46fcfb38a7a613f61 Mon Sep 17 00:00:00 2001 From: bkrukowski Date: Mon, 25 Jul 2022 22:54:07 +0400 Subject: [PATCH 22/24] Setup GitHub Actions for v3.0 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9189835..2be0fdf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -51,7 +51,7 @@ jobs: if: startsWith(matrix.php-versions, '5.') || startsWith(matrix.php-versions, '7.') uses: php-actions/composer@v6 with: - php_version: ${{ matrix.php-versions }} + php_version: 8.1 args: --working-dir=dev-tools version: 1 From 187aefc5bb9a345d3f303eb34e2f1bd5a288b5e9 Mon Sep 17 00:00:00 2001 From: bkrukowski Date: Mon, 25 Jul 2022 22:58:40 +0400 Subject: [PATCH 23/24] Setup GitHub Actions for v3.0 --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2be0fdf..426e3e7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -36,7 +36,7 @@ jobs: - name: Install dependencies uses: php-actions/composer@v6 with: - php_version: 8.1 + php_version: 7.1 version: 1 - name: Setup dev-tools/composer.json @@ -44,14 +44,14 @@ jobs: uses: php-actions/composer@v6 with: command: config platform.php ${{ matrix.php-versions }}.99 - php_version: 8.1 + php_version: 7.1 version: 1 - name: Install dev-tools if: startsWith(matrix.php-versions, '5.') || startsWith(matrix.php-versions, '7.') uses: php-actions/composer@v6 with: - php_version: 8.1 + php_version: 7.1 args: --working-dir=dev-tools version: 1 From dc55650c2e1929f642b7152bf5eef82ce3a32e76 Mon Sep 17 00:00:00 2001 From: bkrukowski Date: Mon, 25 Jul 2022 23:01:59 +0400 Subject: [PATCH 24/24] Setup GitHub Actions for v3.0 --- tests/TestCase.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/TestCase.php b/tests/TestCase.php index 09dc018..1b81a5c 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -25,6 +25,7 @@ public function expectException_($class) { if (\method_exists($this, 'expectException')) { $this->expectException($class); + return; } $this->setProperty('expectedException', $class); @@ -37,6 +38,7 @@ public function expectExceptionMessage_($message) { if (\method_exists($this, 'expectExceptionMessage')) { $this->expectExceptionMessage($message); + return; } $this->setProperty('expectedExceptionMessage', $message);