Skip to content

Conversation

@ThomasLandauer
Copy link
Member

Page: https://codeception.com/docs/AdvancedUsage#BeforeAfter-Attributes

This is the most important change:

The referenced method needs to be in the same class as the public function.

I took the info from here: https://github.com/Codeception/Codeception/blob/main/src/Codeception/Subscriber/BeforeAfterTest.php#L49 - please doublecheck.

Page: https://codeception.com/docs/AdvancedUsage#BeforeAfter-Attributes

This is the most important change:

> The referenced method needs to be in the same class as the public function.

I took the info from here: https://github.com/Codeception/Codeception/blob/main/src/Codeception/Subscriber/BeforeAfterTest.php#L49 - please doublecheck.
@ThomasLandauer ThomasLandauer changed the title Update AdvancedUsage.md: Before/After improvments Update AdvancedUsage.md: Before/After improvements Jun 5, 2025
protected function login(AcceptanceTester $I)
final class ModeratorCest
{
protected function login(FunctionalTester $I): void
Copy link
Member

Choose a reason for hiding this comment

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

I can't remember if the scenarios are generated with : void, so I'm not sure about this change.
Could you confirm if this is how it works and ideally link the PR where this change was added?
Thanks!
There are also conflicts that need to be resolved.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

@TavoNiievez TavoNiievez left a comment

Choose a reason for hiding this comment

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

LGTM!

@TavoNiievez TavoNiievez merged commit 4261257 into Codeception:master Nov 28, 2025
@ThomasLandauer ThomasLandauer deleted the patch-2 branch November 28, 2025 11:53
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