diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..5ace4600a1 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 606986b374..4d923fd215 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,8 @@ on: pull_request: branches-ignore: gh-pages push: - branches-ignore: gh-pages + branches: + - main name: build @@ -20,7 +21,7 @@ jobs: - name: Install PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' ini-values: memory_limit=-1, date.timezone='UTC' tools: phpcs @@ -45,13 +46,15 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - php: ['8.0', '8.1', '8.2'] + php: ['8.1', '8.2', '8.3', '8.4'] mode: ['stable', 'experimental'] exclude: - - php: '8.1' - mode: 'experimental' - php: '8.2' mode: 'experimental' + - php: '8.3' + mode: 'experimental' + - php: '8.4' + mode: 'experimental' steps: - name: Checkout @@ -87,15 +90,15 @@ jobs: if: matrix.mode == 'stable' run: composer update --no-interaction --no-progress --optimize-autoloader --ansi - - name: Composer install lowest versions of dependencies on PHP 8.0 in experimental mode - if: matrix.php == '8.0' && matrix.mode == 'experimental' + - name: Composer install lowest versions of dependencies on PHP 8.1 in experimental mode + if: matrix.php == '8.1' && matrix.mode == 'experimental' run: composer update --prefer-lowest --no-interaction --no-progress --optimize-autoloader --ansi - name: Test that failing test really fails run: if php codecept run -c tests/data/claypit/ scenario FailedCept -vvv; then echo "Test hasn't failed"; false; fi; -# - name: Run tests without code coverage on PHP 8.0 -# if: matrix.php == '8.0' +# - name: Run tests without code coverage on PHP 8.1 +# if: matrix.php == '8.1' # run: | # php -S 127.0.0.1:8008 -t tests/data/app >/dev/null 2>&1 & # php codecept build @@ -137,7 +140,7 @@ jobs: fail-fast: false matrix: os: [windows-latest] - php: ['8.0', '8.1', '8.2'] + php: ['8.1', '8.2', '8.3', '8.4'] steps: - name: Checkout @@ -172,7 +175,7 @@ jobs: run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi - name: Run tests cli - if: matrix.php != '8.1' + if: matrix.php != '8.2' run: php codecept run cli --skip-group coverage - name: Run tests unit diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index cec660bde1..0a04cbfc63 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -12,5 +12,6 @@ 'array_syntax' => ['syntax' => 'short'], 'braces' => ['allow_single_line_closure' => true,], 'no_spaces_after_function_name' => true, + 'nullable_type_declaration_for_default_null_value' => true, 'single_blank_line_at_eof' => true, ])->setFinder($finder); diff --git a/CHANGELOG-5.x.md b/CHANGELOG-5.x.md index ba2aa54d13..745631fbc6 100644 --- a/CHANGELOG-5.x.md +++ b/CHANGELOG-5.x.md @@ -1,3 +1,19 @@ +#### 5.2.0 + +* Fix FAIL message color highlighting by @antonvolokha in #6754 +* Update the codebase to PHP 8.1 by @TavoNiievez in #6747 +* generate:cest: Adding `declare(strict_types=1);` and return type `void` to generated files by @ThomasLandauer in #6736 +* Declare nullable parameter types explicitly by @W0rma in #6774 , #6775 +* chore: Included githubactions in the dependabot config (#6471) by @SamMousa in #6783 +* Added new option --disable-coverage-php to skip coverage.serialized report by @adrenalinkin in #6761 +* chore: add branch alias for main to fix composer install with dev deps by @SamMousa in #6787 +* chore(ci): prevent test CI running twice on PR branches by @SamMousa in #6788 +* Simplify classes by @TavoNiievez in #6767 , #6750 , #6764 +* PHP 8.4: `E_STRICT` deprecation by @W0rma in #6802 +* Fix PHP 8.4 deprecation. by @kagg-design in #6811 +* Fix test suite names in bootstrap command by @W0rma in #6813 +* Docs (minor) by @ThomasLandauer in #6804 , #6805 , #6806 , 6807 , #6792 , #6810 , #6751 , #6744 + #### 5.1.2 * Prevent unrelated error from being displayed if a scenario step has failed by @craig-mcmahon in #6743 diff --git a/composer.json b/composer.json index 31b219bf16..d462bd24c0 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "minimum-stability": "RC", "require": { - "php": "^8.0", + "php": "^8.1", "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", @@ -28,12 +28,12 @@ "phpunit/php-timer": "^5.0.3 || ^6.0 || ^7.0", "sebastian/comparator": "^4.0.5 || ^5.0 || ^6.0", "sebastian/diff": "^4.0.3 || ^5.0 || ^6.0", - "symfony/console": ">=4.4.24 <8.0", - "symfony/css-selector": ">=4.4.24 <8.0", - "symfony/event-dispatcher": ">=4.4.24 <8.0", - "symfony/finder": ">=4.4.24 <8.0", - "symfony/yaml": ">=4.4.24 <8.0", - "symfony/var-dumper": ">=4.4.24 <8.0", + "symfony/console": ">=5.4.24 <8.0", + "symfony/css-selector": ">=5.4.24 <8.0", + "symfony/event-dispatcher": ">=5.4.24 <8.0", + "symfony/finder": ">=5.4.24 <8.0", + "symfony/yaml": ">=5.4.24 <8.0", + "symfony/var-dumper": ">=5.4.24 <8.0", "psy/psysh": "^0.11.2 || ^0.12" }, "require-dev": { @@ -46,8 +46,8 @@ "codeception/module-filesystem": "*@dev", "codeception/module-phpbrowser": "*@dev", "codeception/util-universalframework": "*@dev", - "symfony/process": ">=4.4.24 <8.0", - "symfony/dotenv": ">=4.4.24 <8.0", + "symfony/process": ">=5.4.24 <8.0", + "symfony/dotenv": ">=5.4.24 <8.0", "vlucas/phpdotenv": "^5.1", "jetbrains/phpstorm-attributes": "^1.0" }, @@ -68,7 +68,11 @@ "replace": { "codeception/phpunit-wrapper": "*" }, - + "extra": { + "branch-alias": { + "dev-main": "5.2.x-dev" + } + }, "autoload": { "classmap": [ "src/PHPUnit/TestCase.php" @@ -112,6 +116,7 @@ "codeception/module-db": "source", "codeception/module-filesystem": "source", "codeception/module-phpbrowser": "source", + "codeception/lib-innerbrowser": "source", "*": "dist" } } diff --git a/ext/DotReporter.php b/ext/DotReporter.php index f048ae49af..53d9ac3518 100644 --- a/ext/DotReporter.php +++ b/ext/DotReporter.php @@ -13,7 +13,7 @@ /** * DotReporter provides less verbose output for test execution. - * Like PHPUnit printer it prints dots "." for successful testes and "F" for failures. + * Like PHPUnit printer it prints dots "." for successful tests and "F" for failures. * * ![](https://cloud.githubusercontent.com/assets/220264/26132800/4d23f336-3aab-11e7-81ba-2896a4c623d2.png) * diff --git a/ext/Recorder.php b/ext/Recorder.php index d8641dd967..0ddbd1533f 100644 --- a/ext/Recorder.php +++ b/ext/Recorder.php @@ -10,6 +10,7 @@ use Codeception\Exception\ExtensionException; use Codeception\Extension; use Codeception\Lib\Interfaces\ScreenshotSaver; +use Codeception\Module; use Codeception\Module\WebDriver; use Codeception\Step; use Codeception\Step\Comment as CommentStep; @@ -48,14 +49,14 @@ use function uniqid; /** - * Saves a screenshot of each step in acceptance tests and shows them as a slideshow on one HTML page (here's an [example](https://codeception.com/images/recorder.gif)) - * Activated only for suites with WebDriver module enabled. + * Saves a screenshot of each step in acceptance tests and shows them as a slideshow on one HTML page (here's an [example](https://codeception.com/images/recorder.gif)). + * Works only for suites with WebDriver module enabled. * * The screenshots are saved to `tests/_output/record_*` directories, open `index.html` to see them as a slideshow. * * #### Installation * - * Add this to the list of enabled extensions in `codeception.yml` or `acceptance.suite.yml`: + * Add this to the list of enabled extensions in `codeception.yml` or `Acceptance.suite.yml`: * * ``` yaml * extensions: @@ -86,7 +87,7 @@ * ``` * #### Skipping recording of steps with annotations * - * It is also possible to skip recording of steps for specified tests by using the @skipRecording annotation. + * It is also possible to skip recording of steps for specified tests by using the `@skipRecording` annotation. * * ```php * /** @@ -99,7 +100,6 @@ * $I->amOnUrl('https://codeception.com'); * } * ``` - * */ class Recorder extends Extension { @@ -283,7 +283,7 @@ class Recorder extends Extension Events::STEP_AFTER => 'afterStep', ]; - protected ?\Codeception\Module $webDriverModule = null; + protected ?Module $webDriverModule = null; protected ?string $dir = null; @@ -345,12 +345,12 @@ public function beforeSuite(): void public function afterSuite(): void { - if (!$this->webDriverModule) { + if (!$this->webDriverModule instanceof Module) { return; } $links = ''; - if (!empty($this->slides)) { + if ($this->slides !== []) { foreach ($this->recordedTests as $suiteName => $suite) { $links .= "