Codeception icon indicating copy to clipboard operation
Codeception copied to clipboard

Allow single #[Examples] attribute

Open W0rma opened this issue 1 year ago • 1 comments

Fixes https://github.com/Codeception/Codeception/issues/6726

The current implementation of the #[Examples] attribute differs from what is documented at https://codeception.com/docs/AdvancedUsage#Examples-Attribute (reported in https://github.com/Codeception/codeception.github.com/pull/870).

Futhermore, it is currently not possible to use a single #[Examples] attribute in a test.

This PR is based on https://github.com/Codeception/Codeception/pull/6752 which was closed automatically a few months ago and fixed the behavior.

This PR replaces https://github.com/Codeception/Codeception/pull/6789 which is about the same issue.

W0rma avatar Dec 05 '24 09:12 W0rma

@W0rma OK, here's what I think about it:

If this introduces a BC there is no alternative but to point it to the next major version 6.0.

You can integrate this right now by creating a way to manually activate it with the old behavior being the default.

I prepared a PR of how I imagine you could implement it: https://github.com/W0rma/Codeception/pull/1

You would have to add documentation here and there and think of better names for the flag, but this is the only way I see to add this in 5.x.

Plan C is to make a new .yml configuration parameter for this.

I agree with SamMousa that this could still be designed better, so it would be a feature marked as experimental (in other words, we are not yet going to deprecate current behavior).

TavoNiievez avatar May 02 '25 06:05 TavoNiievez