Skip to content

Behat steps: support file names containing spaces - #342

Merged
swissspidy merged 1 commit into
mainfrom
fix/given-step
Jul 29, 2026
Merged

Behat steps: support file names containing spaces#342
swissspidy merged 1 commit into
mainfrom
fix/given-step

Conversation

@swissspidy

@swissspidy swissspidy commented Jul 29, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of file and cache paths containing spaces or quotation marks.
    • File creation and existence checks now correctly resolve quoted paths and preserve exact file contents.
    • Added coverage for quoted filenames in both regular and cache directories.

@swissspidy
swissspidy requested a review from a team as a code owner July 29, 2026 10:04
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 41de7ab5-9c22-4817-8162-5241df9ad5dd

📥 Commits

Reviewing files that changed from the base of the PR and between 7b76232 and 7cd6605.

📒 Files selected for processing (3)
  • features/behat-steps.feature
  • src/Context/GivenStepDefinitions.php
  • src/Context/ThenStepDefinitions.php

📝 Walkthrough

Walkthrough

Quoted file and cache paths containing spaces are now normalized by Behat steps, with scenarios covering creation, existence, and exact content assertions.

Changes

Quoted path handling

Layer / File(s) Summary
Normalize quoted step paths
src/Context/GivenStepDefinitions.php, src/Context/ThenStepDefinitions.php
Given and Then steps trim whitespace and remove surrounding double quotes before processing file paths.
Validate spaced filenames
features/behat-steps.feature
Behat scenarios verify regular and cache files with quoted filenames containing spaces, including their expected contents.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: brianhenryie

Sequence Diagram(s)

sequenceDiagram
  participant BehatScenario
  participant GivenStepDefinitions
  participant ThenStepDefinitions
  participant Filesystem
  BehatScenario->>GivenStepDefinitions: provide quoted file or cache path
  GivenStepDefinitions->>Filesystem: create file at normalized path
  BehatScenario->>ThenStepDefinitions: assert quoted path
  ThenStepDefinitions->>Filesystem: verify existence and contents
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: Behat steps now support file names containing spaces.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/given-step

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 PHPStan (2.2.6)

PHPStan was skipped because the config uses disallowed bootstrapFiles, bootstrapFile, or includes directives.


Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/Context/GivenStepDefinitions.php 0.00% 1 Missing ⚠️
src/Context/ThenStepDefinitions.php 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@swissspidy swissspidy added this to the 5.1.12 milestone Jul 29, 2026
@swissspidy
swissspidy merged commit 72da881 into main Jul 29, 2026
84 checks passed
@swissspidy
swissspidy deleted the fix/given-step branch July 29, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope:testing Related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant