Skip to content

Conversation

@carlos-granados
Copy link
Contributor

No description provided.

| option | value |
| --profile | constructor_args |
| features/autowire.feature | |
Then it should pass
Copy link
Contributor

@acoulton acoulton Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing scenarios are very relaxed on what qualifies as success (basically just that Behat exited 0). When there was only one context class available for it to use that was maybe ok-ish (if we trust that Behat did actually run to completion).

But we're now also trusting that the wiring from the profile specified in the feature file through the config file in the fixture is definitely running the ConstructorArgsContext and not e.g. one of the other contexts that might be passing for an unrelated reason to what we're trying to prove.

That feels like it gets a bit risky long-term.

Could we perhaps move to a "Then it should pass with" and use the pretty format output to assert that the correct context class & step was executed?

This would also make it a little easier for a new user to understand exactly what this scenario is meant to cover?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I modified the tests to show the actual output

Copy link
Contributor

@acoulton acoulton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I think that helps a lot :)

@carlos-granados carlos-granados merged commit 1a2973a into Behat:3.x Nov 28, 2025
21 checks passed
@carlos-granados carlos-granados deleted the refactor-autowire-tests branch November 28, 2025 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants