From 54a839e4acfc372f39db0d0d2af1b88a6d9b4cf4 Mon Sep 17 00:00:00 2001 From: Gustavo Nieves <64917965+TavoNiievez@users.noreply.github.com> Date: Thu, 29 Dec 2022 00:50:11 -0500 Subject: [PATCH 1/6] Update readme with supported versions. --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index b844e36..0b46c48 100644 --- a/readme.md +++ b/readme.md @@ -9,7 +9,7 @@ A Codeception module for Laravel framework. ## Requirements -* `Laravel 6` or higher. +* `Laravel 8` or higher, as per the [Laravel supported versions](https://laravel.com/docs/master/releases#support-policy). * `PHP 7.4` or higher. ## Installation From c321fcbb4beaba4f3623a5dc524c18e6fd5c1776 Mon Sep 17 00:00:00 2001 From: Gintautas Miselis Date: Thu, 9 Feb 2023 08:31:18 +0200 Subject: [PATCH 2/6] Support lib-innerbrowser v4 --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 9be04a4..05879fa 100644 --- a/composer.json +++ b/composer.json @@ -21,13 +21,13 @@ "require": { "php": "^8.0", "ext-json": "*", - "codeception/lib-innerbrowser": "^3.1", - "codeception/codeception": "^5.0.0-RC2", + "codeception/lib-innerbrowser": "^3.1 | ^4.0", + "codeception/codeception": "^5.0.8", "vlucas/phpdotenv": "^5.3" }, "require-dev": { "codeception/module-asserts": "^3.0", - "codeception/module-rest": "^3.1", + "codeception/module-rest": "^3.3", "laravel/framework": "^8.0" }, "autoload": { From 4cc91aad2b8933d3531926e501776d19f8a5fa9e Mon Sep 17 00:00:00 2001 From: Gintautas Miselis Date: Thu, 9 Feb 2023 08:38:29 +0200 Subject: [PATCH 3/6] Run tests on PHP 8.2, upgrade actions --- .github/workflows/main.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e929c15..5418df2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,12 +8,12 @@ jobs: strategy: matrix: - php: [8.0, 8.1] + php: [8.0, 8.1, 8.2] laravel: [8] steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -25,7 +25,7 @@ jobs: - name: Checkout Laravel 8 Sample if: matrix.laravel == 8 - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: codeception/laravel-module-tests path: framework-tests @@ -36,7 +36,7 @@ jobs: run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v2.1.3 + uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} @@ -64,4 +64,4 @@ jobs: working-directory: framework-tests - name: Run test suite - run: php vendor/bin/codecept run Functional -c framework-tests \ No newline at end of file + run: php vendor/bin/codecept run Functional -c framework-tests From b2e273d16a8a3f5bfb00e58a02a74203cb155f18 Mon Sep 17 00:00:00 2001 From: Adrian Date: Mon, 13 Jan 2025 09:33:31 +0100 Subject: [PATCH 4/6] fix: use the request object resolved from the app container as parameter to kernel's terminate method call (#52) --- src/Codeception/Lib/Connector/Laravel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Codeception/Lib/Connector/Laravel.php b/src/Codeception/Lib/Connector/Laravel.php index ab07df3..2bdad83 100644 --- a/src/Codeception/Lib/Connector/Laravel.php +++ b/src/Codeception/Lib/Connector/Laravel.php @@ -111,7 +111,7 @@ protected function doRequest($request): Response $request = Request::createFromBase($request); $response = $this->kernel->handle($request); - $this->getHttpKernel()->terminate($request, $response); + $this->getHttpKernel()->terminate($this->app['request'], $response); return $response; } From ba308fc6cae9559cc28f6347a93acf6f8a3cacb4 Mon Sep 17 00:00:00 2001 From: Aliaksei Sanikovich Date: Mon, 13 Jan 2025 11:43:32 +0300 Subject: [PATCH 5/6] Call forgetBootstrappers after test (#53) --- src/Codeception/Module/Laravel.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Codeception/Module/Laravel.php b/src/Codeception/Module/Laravel.php index a1bf8d9..129c5b7 100644 --- a/src/Codeception/Module/Laravel.php +++ b/src/Codeception/Module/Laravel.php @@ -24,6 +24,7 @@ use Codeception\Subscriber\ErrorHandler; use Codeception\TestInterface; use Codeception\Util\ReflectionHelper; +use Illuminate\Console\Application as Artisan; use Illuminate\Contracts\Config\Repository as Config; use Illuminate\Contracts\Foundation\Application as ApplicationContract; use Illuminate\Database\Connection; @@ -261,6 +262,8 @@ public function _after(TestInterface $test) unset($this->app[\Faker\Generator::class]); unset($this->app[\Illuminate\Database\Eloquent\Factory::class]); } + + Artisan::forgetBootstrappers(); } /** From dfc426ab2214d7ac99a03972e70a250c4d0e63dc Mon Sep 17 00:00:00 2001 From: Aaron Gustavo Nieves <64917965+TavoNiievez@users.noreply.github.com> Date: Tue, 14 Jan 2025 15:30:01 -0500 Subject: [PATCH 6/6] Update CI (#54) --- .github/workflows/main.yml | 35 +++++++++++++++++++++++------------ composer.json | 4 ++-- readme.md | 4 ++-- 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5418df2..fd75a49 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,12 +8,12 @@ jobs: strategy: matrix: - php: [8.0, 8.1, 8.2] - laravel: [8] + php: [8.2, 8.3, 8.4] + laravel: [10, 11] steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -23,17 +23,21 @@ jobs: extensions: ctype, iconv, intl, json, mbstring, pdo, pdo_sqlite coverage: none - - name: Checkout Laravel 8 Sample - if: matrix.laravel == 8 - uses: actions/checkout@v3 + - name: Set Laravel version reference + run: echo "LV_REF=${MATRIX_LARAVEL%.*}" >> $GITHUB_ENV + env: + MATRIX_LARAVEL: ${{ matrix.laravel }} + + - name: Checkout Laravel ${{ env.LV_REF }} Sample + uses: actions/checkout@v4 with: repository: codeception/laravel-module-tests path: framework-tests - ref: main + ref: ${{ env.LV_REF }}.x - name: Get composer cache directory id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache composer dependencies uses: actions/cache@v3 @@ -42,20 +46,27 @@ jobs: key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer- + - name: Install PHPUnit 11 + run: composer require --dev --no-update "phpunit/phpunit=^11.0" + - name: Install dependencies - run: composer install --prefer-dist --no-progress + run: | + composer require symfony/console:^6.0 || ^7.0 --no-update + composer require codeception/module-asserts="3.*" --no-update + composer update --prefer-dist --no-progress --no-dev - name: Validate composer.json and composer.lock - run: composer validate + run: composer validate --strict working-directory: framework-tests - name: Install Laravel Sample run: | composer remove codeception/module-laravel --dev --no-update - composer install --no-progress + composer require phpunit/phpunit:^11.0 --dev --no-update + composer update --no-progress working-directory: framework-tests - - name: Prepare the test environment and run test suite + - name: Prepare the test environment run: | cp .env.testing .env php artisan config:cache diff --git a/composer.json b/composer.json index 05879fa..ead9d2c 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ ], "minimum-stability": "RC", "require": { - "php": "^8.0", + "php": "^8.2", "ext-json": "*", "codeception/lib-innerbrowser": "^3.1 | ^4.0", "codeception/codeception": "^5.0.8", @@ -28,7 +28,7 @@ "require-dev": { "codeception/module-asserts": "^3.0", "codeception/module-rest": "^3.3", - "laravel/framework": "^8.0" + "laravel/framework": "^10.0 | ^11.0" }, "autoload": { "classmap": ["src/"] diff --git a/readme.md b/readme.md index 0b46c48..87f0ec6 100644 --- a/readme.md +++ b/readme.md @@ -9,8 +9,8 @@ A Codeception module for Laravel framework. ## Requirements -* `Laravel 8` or higher, as per the [Laravel supported versions](https://laravel.com/docs/master/releases#support-policy). -* `PHP 7.4` or higher. +* `Laravel 10` or higher, as per the [Laravel supported versions](https://laravel.com/docs/master/releases#support-policy). +* `PHP 8.2` or higher. ## Installation