Skip to content

Incorrect path for behat i18n.php file #6833

@santilin

Description

@santilin

Describe the bug
i18n.php file cannot be loaded in Gherkin tests due to incorrect file path resolution in Gherkin.php loader.

To Reproduce
Steps to reproduce the behavior:

  1. Configure Codeception 5.0 with Gherkin and i18n support
  2. Create Gherkin feature files with localized steps
  3. Run tests using codecept run
  4. See error: "Failed opening required '.../i18n.php'"

Expected behavior
Successful loading of i18n.php for Gherkin localization support.

Screenshots/Code Snippets
Problematic code in vendor/codeception/codeception/src/Codeception/Test/Loader/Gherkin.php:77:

$i18n = require $gherkinClassPath . '/../../../i18n.php';

Proposed Fix

 $i18n = require $gherkinClassPath . '/../i18n.php';

Environment

  • Codeception version: 5.0.x
  • PHP Version: 8.2
  • Operating System: debian 12
  • Installation type: Composer

Additional context
The incorrect relative path breaks Gherkin's internationalization support. The correct path should resolve to:
src/Codeception/Test/Loader/../i18n.php instead of navigating three directories up. This matches the actual file structure in the Codeception repository.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions