Skip to content

[4.x]: 4.14.2 fails tests on Codeception 5 / Yii2 module 1.1.6+ #16577

@qrazi

Description

@qrazi

What happened?

Description

Updated our project from Craft CMS 4.14.1 to 4.14.2. Codeception tests fail immediately with a 255 exit code. Error to be found in ./storage/logs/phperrors.log.

This is caused by using codeception/module-yii2 >=1.1.6. See the change: Codeception/module-yii2@1.1.5...1.1.6.

I'll create a PR as well with a suggested solution to the code.

Error:

PHP Fatal error:  Declaration of craft\test\CraftConnector::startApp(): void must be compatible with Codeception\Lib\Connector\Yii2::startApp(?yii\log\Logger $logger = null): void in /app/vendor/craftcms/cms/src/test/CraftConnector.php on line 135

Steps to reproduce

  1. Install Craft CMS 4.14.2
  2. Add testing by following documentation: https://craftcms.com/docs/4.x/testing/codeception.html
  3. Also add codeception/module-yii2 as this is required by Craft CMS test tooling

Expected behavior

Example test runs successfully.

Actual behavior

Example test fails with exit code 255 and no further error on CLI, error in phperrors.log

Craft CMS version

4.14.2

PHP version

8.2.6

Operating system and version

Docker container running Alpine Linux 3.18.0

Database type and version

Docker container MySQL 8.0.29

Image driver and version

GD 8.2.6

Installed plugins and versions

  • Amazon S3 2.2.1
  • Blitz 4.23.10
  • Breadcrumb 2.0.0
  • Calendar 5.0.13
  • CKEditor 3.11.0
  • Compress 4.0.1
  • Craftagram 3.0.0
  • Design Tokens 1.1.1
  • Doxter 5.0.6
  • Element API 4.2.0
  • Elements Panel 2.0.0
  • Embedded Assets 4.2.1
  • Feed Me 5.9.0
  • Formie 2.1.40
  • Hide Admin 2.0.0-beta.1
  • HTTP Basic Authentication dev-patch_2_fix_CVE-2024-51736
  • Image Base64 1.1.1
  • Imager dev-dev-craft4
  • Linkit 4.0.4.1
  • Maps 4.0.8
  • Mix v1.7.2
  • Navigation 2.1.1
  • Neo 4.2.24
  • Password Policy 4.1.0
  • PDF Generator 3.0.0
  • Retour 4.1.22
  • Scout 4.1.2
  • SEOmatic 4.1.11
  • Shortcodes 3.0.0
  • Simple Logger 1.0.2
  • Spoon 4.0.4
  • Two-Factor Authentication 3.4.0
  • Vite 4.0.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions