From 533dd08217d39a1e6c369921283a8746b7d9ef77 Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Mon, 22 Mar 2021 22:58:53 +0100 Subject: [PATCH 01/40] Github Actions CI on push --- .github/workflows/ci.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..30de95a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,21 @@ +name: CI + +on: [push] + +jobs: + build-test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - uses: php-actions/composer@v5 + + - name: PHPUnit Tests + uses: php-actions/phpunit@v6 + with: + bootstrap: tests/bootstrap.php + php_version: 7.4 + php_extensions: json + configuration: phpunit.xml + args: --coverage-text \ No newline at end of file From cb2cb91a0a36a048c60d8e3b8992db8d73ec0cbd Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Mon, 22 Mar 2021 23:00:39 +0100 Subject: [PATCH 02/40] Add on pull request --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 30de95a..4b5ddb9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,6 @@ name: CI -on: [push] +on: [push, pull_request] jobs: build-test: From deb6922d0cdfe49765ad0400ce8e3ce161ef2d68 Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Mon, 22 Mar 2021 23:10:20 +0100 Subject: [PATCH 03/40] change php version to 7.1 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b5ddb9..b74627d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: uses: php-actions/phpunit@v6 with: bootstrap: tests/bootstrap.php - php_version: 7.4 + php_version: 7.1 php_extensions: json configuration: phpunit.xml args: --coverage-text \ No newline at end of file From 70138223581085347404afa48bfe7d78e2052f66 Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Mon, 22 Mar 2021 23:13:05 +0100 Subject: [PATCH 04/40] changed bootstrap file --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b74627d..5e45670 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: - name: PHPUnit Tests uses: php-actions/phpunit@v6 with: - bootstrap: tests/bootstrap.php + bootstrap: vendor/autoload.php php_version: 7.1 php_extensions: json configuration: phpunit.xml From 21710c083cbb6f8bcab72d8cd946ed235575ee95 Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Mon, 22 Mar 2021 23:19:18 +0100 Subject: [PATCH 05/40] Trying to fix docker build error --- .github/workflows/ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5e45670..cd82176 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,14 +8,12 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: php-actions/composer@v5 - - name: PHPUnit Tests uses: php-actions/phpunit@v6 with: bootstrap: vendor/autoload.php php_version: 7.1 - php_extensions: json + version: 1 configuration: phpunit.xml args: --coverage-text \ No newline at end of file From c67c6759a8dadafbd3dce97e78c94076ab88704c Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Mon, 22 Mar 2021 23:28:16 +0100 Subject: [PATCH 06/40] Try without unit tests --- .github/workflows/ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd82176..9b32593 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,12 +8,10 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: php-actions/composer@v5 - name: PHPUnit Tests - uses: php-actions/phpunit@v6 + uses: php-actions/composer@v5 with: bootstrap: vendor/autoload.php php_version: 7.1 - version: 1 configuration: phpunit.xml args: --coverage-text \ No newline at end of file From 029739f24140e65fb5b773a5c59c615e908f76b6 Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Mon, 22 Mar 2021 23:31:39 +0100 Subject: [PATCH 07/40] Just install composer without tests --- .github/workflows/ci.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9b32593..9c3d96e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,10 +8,7 @@ jobs: steps: - uses: actions/checkout@v2 - - name: PHPUnit Tests + - name: Setup composer uses: php-actions/composer@v5 with: - bootstrap: vendor/autoload.php - php_version: 7.1 - configuration: phpunit.xml - args: --coverage-text \ No newline at end of file + php_version: 7.1 \ No newline at end of file From 3c8740769a571bb2704632f45cf5295488b81723 Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Mon, 22 Mar 2021 23:36:32 +0100 Subject: [PATCH 08/40] No try to add unit tests --- .github/workflows/ci.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9c3d96e..c4d8f0a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,4 +11,10 @@ jobs: - name: Setup composer uses: php-actions/composer@v5 with: - php_version: 7.1 \ No newline at end of file + php_version: 7.1 + - name: PHPUnit tests + uses: php-actions/phpunit@v2 + with: + php_version: 7.1 + bootstrap: tests/bootstrap.php + configuration: phpunit.xml \ No newline at end of file From 791ba3199d85852ad415717ef3085f473792fc15 Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Mon, 22 Mar 2021 23:38:23 +0100 Subject: [PATCH 09/40] Error says phpunit needs PHP >= 7.3, let's try it --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c4d8f0a..447277d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,10 +11,10 @@ jobs: - name: Setup composer uses: php-actions/composer@v5 with: - php_version: 7.1 + php_version: 7.3 - name: PHPUnit tests uses: php-actions/phpunit@v2 with: - php_version: 7.1 + php_version: 7.3 bootstrap: tests/bootstrap.php configuration: phpunit.xml \ No newline at end of file From 0e58d556f04ce0915907130fb371abfb00b22bdf Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Mon, 22 Mar 2021 23:45:37 +0100 Subject: [PATCH 10/40] Maby have to add args? --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 447277d..bbeb7b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,4 +17,5 @@ jobs: with: php_version: 7.3 bootstrap: tests/bootstrap.php - configuration: phpunit.xml \ No newline at end of file + configuration: phpunit.xml + args: --coverage-text \ No newline at end of file From eebd537749a6a6798df8698752e566befb5e416c Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Mon, 22 Mar 2021 23:55:11 +0100 Subject: [PATCH 11/40] removed syntaxCheck (throws error) https://stackoverflow.com/questions/44328114/phpunit-what-does-syntaxcheck-configuration-parameter-stands-for-exactly/44331140#44331140 --- phpunit.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/phpunit.xml b/phpunit.xml index 6e8f0c6..7aa2ef4 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -9,8 +9,7 @@ convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" - stopOnFailure="false" - syntaxCheck="false"> + stopOnFailure="false"> tests/Pecee/SimpleRouter/ From f9c0c83b7092f4e34a178607dd0774777b647cd3 Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Tue, 23 Mar 2021 00:09:45 +0100 Subject: [PATCH 12/40] migrate configuration --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bbeb7b3..bc039ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,7 @@ jobs: uses: php-actions/composer@v5 with: php_version: 7.3 + - run: ./vendor/bin/phpunit --migrate-configuration - name: PHPUnit tests uses: php-actions/phpunit@v2 with: From 4adfa4f32204c61d202bd0574eef9f87039f63cc Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Tue, 23 Mar 2021 00:18:14 +0100 Subject: [PATCH 13/40] Rollback to warning: 'Suggestion: Migrate your XML configuration using --migrate-configuration!' --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc039ed..bbeb7b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,6 @@ jobs: uses: php-actions/composer@v5 with: php_version: 7.3 - - run: ./vendor/bin/phpunit --migrate-configuration - name: PHPUnit tests uses: php-actions/phpunit@v2 with: From aa8211a273ebb99a0bd04428d79460d6a0da9a7e Mon Sep 17 00:00:00 2001 From: Marius Karstedt Date: Tue, 23 Mar 2021 03:23:18 +0100 Subject: [PATCH 14/40] added tests to composer --- .github/workflows/ci.yml | 7 +------ composer.json | 5 +++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bbeb7b3..c7f7797 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,9 +13,4 @@ jobs: with: php_version: 7.3 - name: PHPUnit tests - uses: php-actions/phpunit@v2 - with: - php_version: 7.3 - bootstrap: tests/bootstrap.php - configuration: phpunit.xml - args: --coverage-text \ No newline at end of file + cmd: composer test \ No newline at end of file diff --git a/composer.json b/composer.json index 5d285cd..b472a9b 100644 --- a/composer.json +++ b/composer.json @@ -35,6 +35,11 @@ "phpunit/phpunit": "^6.0", "mockery/mockery": "^1" }, + "scripts": { + "test": [ + "phpunit tests" + ] + }, "autoload": { "psr-4": { "Pecee\\": "src/Pecee/" From 656946fbb26bd56d1c78f54d4e07364bbc0a7157 Mon Sep 17 00:00:00 2001 From: Marius Karstedt Date: Tue, 23 Mar 2021 03:33:51 +0100 Subject: [PATCH 15/40] Used cmd instead of run --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7f7797..f9d228a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,4 +13,4 @@ jobs: with: php_version: 7.3 - name: PHPUnit tests - cmd: composer test \ No newline at end of file + run: composer test \ No newline at end of file From d7a295cb5c877e01aaed6b1d740f4b207cb8b03f Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Tue, 23 Mar 2021 11:53:29 +0100 Subject: [PATCH 16/40] Change php version and test execution --- .github/workflows/ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9d228a..cb658cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,10 @@ jobs: - name: Setup composer uses: php-actions/composer@v5 with: - php_version: 7.3 + php_version: 7.4.6 + - name: PHPUnit version + run: phpunit --version - name: PHPUnit tests + run: phpunit tests + - name: PHPUnit tests 2 run: composer test \ No newline at end of file From 577c87c5275a7d202d828bf2f147205d583b4672 Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Tue, 23 Mar 2021 11:57:03 +0100 Subject: [PATCH 17/40] Try to run phpunit from composer --- .github/workflows/ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb658cd..2cff725 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,6 +15,4 @@ jobs: - name: PHPUnit version run: phpunit --version - name: PHPUnit tests - run: phpunit tests - - name: PHPUnit tests 2 - run: composer test \ No newline at end of file + run: vendor/bin/phpunit tests \ No newline at end of file From 554d562e5631832b343db0717242081e14f3163c Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Tue, 23 Mar 2021 12:04:10 +0100 Subject: [PATCH 18/40] Seem to get no error local, test on actions --- .github/workflows/ci.yml | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2cff725..9c06f5e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,6 @@ jobs: with: php_version: 7.4.6 - name: PHPUnit version - run: phpunit --version + run: vendor/bin/phpunit --version - name: PHPUnit tests run: vendor/bin/phpunit tests \ No newline at end of file diff --git a/composer.json b/composer.json index b472a9b..07e2bf4 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ "php-di/php-di": "^6.0" }, "require-dev": { - "phpunit/phpunit": "^6.0", + "phpunit/phpunit": "^8.5", "mockery/mockery": "^1" }, "scripts": { From 26a1659734354f2b078fa1d192c4682fcb2d01bd Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Tue, 23 Mar 2021 12:07:53 +0100 Subject: [PATCH 19/40] Try to fix failures --- tests/Pecee/SimpleRouter/RouterResourceTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Pecee/SimpleRouter/RouterResourceTest.php b/tests/Pecee/SimpleRouter/RouterResourceTest.php index 0b6f5fb..af8ea85 100644 --- a/tests/Pecee/SimpleRouter/RouterResourceTest.php +++ b/tests/Pecee/SimpleRouter/RouterResourceTest.php @@ -9,7 +9,7 @@ class RouterResourceTest extends \PHPUnit\Framework\TestCase { TestRouter::resource('/resource', 'ResourceController'); $response = TestRouter::debugOutput('/resource', 'post'); - + echo '$response: '.json_encode($response); $this->assertEquals('store', $response); } From 37228d2bac6cd3415b8841ad862219cc9776feee Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Tue, 23 Mar 2021 12:47:24 +0100 Subject: [PATCH 20/40] revert change --- tests/Pecee/SimpleRouter/RouterResourceTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Pecee/SimpleRouter/RouterResourceTest.php b/tests/Pecee/SimpleRouter/RouterResourceTest.php index af8ea85..0b6f5fb 100644 --- a/tests/Pecee/SimpleRouter/RouterResourceTest.php +++ b/tests/Pecee/SimpleRouter/RouterResourceTest.php @@ -9,7 +9,7 @@ class RouterResourceTest extends \PHPUnit\Framework\TestCase { TestRouter::resource('/resource', 'ResourceController'); $response = TestRouter::debugOutput('/resource', 'post'); - echo '$response: '.json_encode($response); + $this->assertEquals('store', $response); } From 87985841ded6c216f2a9ec53532a71cef8006f5f Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Tue, 23 Mar 2021 12:48:49 +0100 Subject: [PATCH 21/40] complete change of tests --- .github/workflows/ci.yml | 81 +++++++++++++++++++++++++++++++++++----- composer.json | 2 +- 2 files changed, 73 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9c06f5e..0eb24af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,15 +4,78 @@ on: [push, pull_request] jobs: build-test: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + env: + PHP_EXTENSIONS: json + PHP_INI_VALUES: assert.exception=1, zend.assertions=1 + + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - windows-latest + php-version: + - 7.3 + - 7.4 + phpunit-version: + - 8.5.2 + dependencies: + - lowest + - highest + include: + - os: ubuntu-latest + php-version: '7.2' + phpunit-version: '8.5.2' + name: PHPUnit Tests steps: - - uses: actions/checkout@v2 - - name: Setup composer - uses: php-actions/composer@v5 + - name: Configure git to avoid issues with line endings + if: matrix.os == 'windows-latest' + run: git config --global core.autocrlf false + - name: Checkout + uses: actions/checkout@v2 + - name: Setup PHP + uses: shivammathur/setup-php@v2 with: - php_version: 7.4.6 - - name: PHPUnit version - run: vendor/bin/phpunit --version - - name: PHPUnit tests - run: vendor/bin/phpunit tests \ No newline at end of file + php-version: ${{ matrix.php-version }} +# tools: phpunit:${{ matrix.phpunit-versions }} + coverage: xdebug + extensions: ${{ env.PHP_EXTENSIONS }} + ini-values: ${{ env.PHP_INI_VALUES }} +# - name: Get composer cache directory +# id: composer-cache +# run: echo "::set-output name=dir::$(composer config cache-files-dir)" + - name: Determine composer cache directory on Linux + if: matrix.os == 'ubuntu-latest' + run: echo "COMPOSER_CACHE_DIR=$(./tools/composer config cache-dir)" >> $GITHUB_ENV + - name: Determine composer cache directory on Windows + if: matrix.os == 'windows-latest' + run: ECHO "COMPOSER_CACHE_DIR=~\AppData\Local\Composer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: ${{ env.COMPOSER_CACHE_DIR }} + key: php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }} + restore-keys: | + php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}- + - name: Install lowest dependencies with composer + if: matrix.dependencies == 'lowest' + run: php ./tools/composer update --no-ansi --no-interaction --no-progress --prefer-lowest + - name: Install highest dependencies with composer + if: matrix.dependencies == 'highest' + run: php ./tools/composer update --no-ansi --no-interaction --no-progress +# - name: Install dependencies +# run: composer install --prefer-dist + - name: Run tests with phpunit + run: php ./phpunit + + +# - name: Setup composer +# uses: php-actions/composer@v5 +# with: +# php_version: 7.4.6 +# - name: PHPUnit version +# run: vendor/bin/phpunit --version +# - name: PHPUnit tests +# run: vendor/bin/phpunit tests \ No newline at end of file diff --git a/composer.json b/composer.json index 07e2bf4..a94ed5b 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,7 @@ }, "scripts": { "test": [ - "phpunit tests" + "php ./phpunit tests" ] }, "autoload": { From 9029a84fddb3b76ee987420429c586024bf7451e Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Tue, 23 Mar 2021 13:04:59 +0100 Subject: [PATCH 22/40] reduced platforms and version for test & added composer --- .github/workflows/ci.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0eb24af..baf8ac4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,15 +15,15 @@ jobs: matrix: os: - ubuntu-latest - - windows-latest +# - windows-latest php-version: - - 7.3 +# - 7.3 - 7.4 phpunit-version: - 8.5.2 - dependencies: - - lowest - - highest +# dependencies: +# - lowest +# - highest include: - os: ubuntu-latest php-version: '7.2' @@ -39,6 +39,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} + tools: composer:v5 # tools: phpunit:${{ matrix.phpunit-versions }} coverage: xdebug extensions: ${{ env.PHP_EXTENSIONS }} From 537d607b9fc709f1d0d77531ea262adc7d1eb9f7 Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Tue, 23 Mar 2021 13:17:07 +0100 Subject: [PATCH 23/40] Try to fix caching bugg --- .github/workflows/ci.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index baf8ac4..a9d444b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,19 +44,20 @@ jobs: coverage: xdebug extensions: ${{ env.PHP_EXTENSIONS }} ini-values: ${{ env.PHP_INI_VALUES }} -# - name: Get composer cache directory -# id: composer-cache -# run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - name: Determine composer cache directory on Linux - if: matrix.os == 'ubuntu-latest' - run: echo "COMPOSER_CACHE_DIR=$(./tools/composer config cache-dir)" >> $GITHUB_ENV - - name: Determine composer cache directory on Windows - if: matrix.os == 'windows-latest' - run: ECHO "COMPOSER_CACHE_DIR=~\AppData\Local\Composer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + - name: Get composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" +# - name: Determine composer cache directory on Linux +# if: matrix.os == 'ubuntu-latest' +# run: echo "COMPOSER_CACHE_DIR=$(./tools/composer config cache-dir)" >> $GITHUB_ENV +# - name: Determine composer cache directory on Windows +# if: matrix.os == 'windows-latest' +# run: ECHO "COMPOSER_CACHE_DIR=~\AppData\Local\Composer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Cache dependencies uses: actions/cache@v2 with: - path: ${{ env.COMPOSER_CACHE_DIR }} +# path: ${{ env.COMPOSER_CACHE_DIR }} + path: ${{ steps.composer-cache.outputs.dir }} key: php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }} restore-keys: | php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}- From 4725b330fed471dbaf83a77c24d0020b5ce24867 Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Tue, 23 Mar 2021 13:19:36 +0100 Subject: [PATCH 24/40] change test command & phpunit file update --- .github/workflows/ci.yml | 2 +- phpunit.xml | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9d444b..c27bc1e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,7 +70,7 @@ jobs: # - name: Install dependencies # run: composer install --prefer-dist - name: Run tests with phpunit - run: php ./phpunit + run: phpunit tests # - name: Setup composer diff --git a/phpunit.xml b/phpunit.xml index 7aa2ef4..6841e44 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -15,9 +15,10 @@ tests/Pecee/SimpleRouter/ - - + + src - - + + From 5eadb79c64745fd7b698a6814b088626ef7d446d Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Tue, 23 Mar 2021 13:20:29 +0100 Subject: [PATCH 25/40] add phpunit tool --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c27bc1e..680ee3b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,8 +39,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} - tools: composer:v5 -# tools: phpunit:${{ matrix.phpunit-versions }} + tools: composer:v5, phpunit:${{ matrix.phpunit-versions }} coverage: xdebug extensions: ${{ env.PHP_EXTENSIONS }} ini-values: ${{ env.PHP_INI_VALUES }} From 495cfba613cb0b9b9ad3cd0dda764303ef905b78 Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Tue, 23 Mar 2021 13:22:32 +0100 Subject: [PATCH 26/40] Added relative path --- tests/bootstrap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 22f8cd2..5258258 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,4 +1,4 @@ Date: Tue, 23 Mar 2021 13:25:44 +0100 Subject: [PATCH 27/40] Try to fix composer install missing --- .github/workflows/ci.yml | 4 ++-- tests/bootstrap.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 680ee3b..b635062 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,8 +21,8 @@ jobs: - 7.4 phpunit-version: - 8.5.2 -# dependencies: -# - lowest + dependencies: + - lowest # - highest include: - os: ubuntu-latest diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 5258258..22f8cd2 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,4 +1,4 @@ Date: Tue, 23 Mar 2021 13:27:18 +0100 Subject: [PATCH 28/40] correct composer exec path --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b635062..a20492f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,10 +62,10 @@ jobs: php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}- - name: Install lowest dependencies with composer if: matrix.dependencies == 'lowest' - run: php ./tools/composer update --no-ansi --no-interaction --no-progress --prefer-lowest + run: php composer update --no-ansi --no-interaction --no-progress --prefer-lowest - name: Install highest dependencies with composer if: matrix.dependencies == 'highest' - run: php ./tools/composer update --no-ansi --no-interaction --no-progress + run: php composer update --no-ansi --no-interaction --no-progress # - name: Install dependencies # run: composer install --prefer-dist - name: Run tests with phpunit From a103c711632034b9f9c42b5281f20cfdfd5d597e Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Tue, 23 Mar 2021 13:28:17 +0100 Subject: [PATCH 29/40] Try to fix composer install missing --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a20492f..e3c354e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,10 +62,10 @@ jobs: php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}- - name: Install lowest dependencies with composer if: matrix.dependencies == 'lowest' - run: php composer update --no-ansi --no-interaction --no-progress --prefer-lowest + run: composer update --no-ansi --no-interaction --no-progress --prefer-lowest - name: Install highest dependencies with composer if: matrix.dependencies == 'highest' - run: php composer update --no-ansi --no-interaction --no-progress + run: composer update --no-ansi --no-interaction --no-progress # - name: Install dependencies # run: composer install --prefer-dist - name: Run tests with phpunit From 69fdfb3560fdb9562fc82acf17d6dbbbd6e7d97d Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Tue, 23 Mar 2021 13:30:57 +0100 Subject: [PATCH 30/40] remove matrix include & PHPUnit requires PHP >= 7.3 --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e3c354e..73fdb12 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,19 +15,19 @@ jobs: matrix: os: - ubuntu-latest -# - windows-latest + - windows-latest php-version: -# - 7.3 - 7.4 + - 8.1 phpunit-version: - 8.5.2 dependencies: - lowest -# - highest - include: - - os: ubuntu-latest - php-version: '7.2' - phpunit-version: '8.5.2' + - highest +# include: +# - os: ubuntu-latest +# php-version: '7.2' +# phpunit-version: '8.5.2' name: PHPUnit Tests steps: - name: Configure git to avoid issues with line endings From c408f79d8a13df968740db89f4438e36fd25aa9d Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Tue, 23 Mar 2021 13:34:55 +0100 Subject: [PATCH 31/40] changed to PHP >= 3 & run test via composer test --- .github/workflows/ci.yml | 3 +-- composer.json | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 73fdb12..b7fa3a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,6 @@ jobs: - windows-latest php-version: - 7.4 - - 8.1 phpunit-version: - 8.5.2 dependencies: @@ -69,7 +68,7 @@ jobs: # - name: Install dependencies # run: composer install --prefer-dist - name: Run tests with phpunit - run: phpunit tests + run: composer test # - name: Setup composer diff --git a/composer.json b/composer.json index a94ed5b..84520bb 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ } ], "require": { - "php": ">=7.1", + "php": ">=7.3", "ext-json": "*", "php-di/php-di": "^6.0" }, From 9f0373938dcec58875c7c6f004f7c9aed5c0c0f1 Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Tue, 23 Mar 2021 13:35:57 +0100 Subject: [PATCH 32/40] fix composer test command --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 84520bb..d4f109c 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,7 @@ }, "scripts": { "test": [ - "php ./phpunit tests" + "phpunit tests" ] }, "autoload": { From 08008ca847b8a174e69ccafed524476277e464be Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Tue, 23 Mar 2021 13:40:08 +0100 Subject: [PATCH 33/40] Add PHP 7.3 check --- .github/workflows/ci.yml | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b7fa3a1..e176f09 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,7 @@ jobs: - ubuntu-latest - windows-latest php-version: + - 7.3 - 7.4 phpunit-version: - 8.5.2 @@ -65,17 +66,5 @@ jobs: - name: Install highest dependencies with composer if: matrix.dependencies == 'highest' run: composer update --no-ansi --no-interaction --no-progress -# - name: Install dependencies -# run: composer install --prefer-dist - name: Run tests with phpunit - run: composer test - - -# - name: Setup composer -# uses: php-actions/composer@v5 -# with: -# php_version: 7.4.6 -# - name: PHPUnit version -# run: vendor/bin/phpunit --version -# - name: PHPUnit tests -# run: vendor/bin/phpunit tests \ No newline at end of file + run: composer test \ No newline at end of file From 62f5e5cbbdba8f7676e41e78fb7b19712fb102da Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Tue, 23 Mar 2021 13:40:22 +0100 Subject: [PATCH 34/40] Add Failing test --- tests/Pecee/SimpleRouter/RouterResourceTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Pecee/SimpleRouter/RouterResourceTest.php b/tests/Pecee/SimpleRouter/RouterResourceTest.php index 0b6f5fb..6f01545 100644 --- a/tests/Pecee/SimpleRouter/RouterResourceTest.php +++ b/tests/Pecee/SimpleRouter/RouterResourceTest.php @@ -10,7 +10,7 @@ class RouterResourceTest extends \PHPUnit\Framework\TestCase TestRouter::resource('/resource', 'ResourceController'); $response = TestRouter::debugOutput('/resource', 'post'); - $this->assertEquals('store', $response); + $this->assertNotEquals('store', $response); } public function testResourceCreate() From 5275653606c25bf4294505e756c95aaef010bc7c Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Tue, 23 Mar 2021 13:41:27 +0100 Subject: [PATCH 35/40] Correct test to succeed --- tests/Pecee/SimpleRouter/RouterResourceTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Pecee/SimpleRouter/RouterResourceTest.php b/tests/Pecee/SimpleRouter/RouterResourceTest.php index 6f01545..0b6f5fb 100644 --- a/tests/Pecee/SimpleRouter/RouterResourceTest.php +++ b/tests/Pecee/SimpleRouter/RouterResourceTest.php @@ -10,7 +10,7 @@ class RouterResourceTest extends \PHPUnit\Framework\TestCase TestRouter::resource('/resource', 'ResourceController'); $response = TestRouter::debugOutput('/resource', 'post'); - $this->assertNotEquals('store', $response); + $this->assertEquals('store', $response); } public function testResourceCreate() From 5095b1abc9d6c778ba90cb4abf21417e2da93f9d Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Tue, 23 Mar 2021 13:54:00 +0100 Subject: [PATCH 36/40] cleanup --- .github/workflows/ci.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e176f09..e7f3549 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,10 +24,6 @@ jobs: dependencies: - lowest - highest -# include: -# - os: ubuntu-latest -# php-version: '7.2' -# phpunit-version: '8.5.2' name: PHPUnit Tests steps: - name: Configure git to avoid issues with line endings @@ -46,16 +42,9 @@ jobs: - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" -# - name: Determine composer cache directory on Linux -# if: matrix.os == 'ubuntu-latest' -# run: echo "COMPOSER_CACHE_DIR=$(./tools/composer config cache-dir)" >> $GITHUB_ENV -# - name: Determine composer cache directory on Windows -# if: matrix.os == 'windows-latest' -# run: ECHO "COMPOSER_CACHE_DIR=~\AppData\Local\Composer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Cache dependencies uses: actions/cache@v2 with: -# path: ${{ env.COMPOSER_CACHE_DIR }} path: ${{ steps.composer-cache.outputs.dir }} key: php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }} restore-keys: | From cfc8b5db43e0c195f74ce33986ffbf906739fab4 Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Tue, 23 Mar 2021 15:44:43 +0100 Subject: [PATCH 37/40] Test PHP Version 7.1 with PHPUnit 7 --- .github/workflows/ci.yml | 3 ++- composer.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e7f3549..08f61c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,8 @@ jobs: - 7.3 - 7.4 phpunit-version: - - 8.5.2 +# - 8.5.2 + - 7 dependencies: - lowest - highest diff --git a/composer.json b/composer.json index 7677496..7b18724 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "ext-json": "*" }, "require-dev": { - "phpunit/phpunit": "^8.0", + "phpunit/phpunit": "^7", "mockery/mockery": "^1" }, "scripts": { From 61fee760b0dfa98e6f7e6556cc72b1238ba880f6 Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Tue, 23 Mar 2021 15:46:22 +0100 Subject: [PATCH 38/40] use phpunit version 7.5.20 like composer --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 08f61c4..fa1f9b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: - 7.4 phpunit-version: # - 8.5.2 - - 7 + - 7.5.20 dependencies: - lowest - highest From 1d480349102708de967077d292388939ee480e56 Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Tue, 23 Mar 2021 15:48:36 +0100 Subject: [PATCH 39/40] code cleanup --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa1f9b0..6f44c1f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,6 @@ jobs: - 7.3 - 7.4 phpunit-version: -# - 8.5.2 - 7.5.20 dependencies: - lowest From 0892f5b6f331685e083dedea31f155805c3732c2 Mon Sep 17 00:00:00 2001 From: DeveloperMarius Date: Tue, 23 Mar 2021 15:49:32 +0100 Subject: [PATCH 40/40] replaced php version 7.3 with with 7.1 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f44c1f..e2ccc7b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: - ubuntu-latest - windows-latest php-version: - - 7.3 + - 7.1 - 7.4 phpunit-version: - 7.5.20