-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] Module class made final
, Codeception docs seem to indicate extends
#110
Comments
I've just tagged new release un-finalizing it. |
Just tested with the newest version and as expected the test suite runs again, thank you! |
I'm reopening this issue for the next major release. Opening up class internals for extension by 3rd party code is really bad for our maintainability and makes it harder to reason about the (supposedly) internal state of our module. |
@qrazi, just a heads up i'm releasing v2; this will reintroduce this issue for you. |
Makes total sense to me, thanks! Now the extending of a (this) module does not work anymore as described in the general documentation: https://codeception.com/docs/ModulesAndHelpers#Extending-a-Module:
So, is this a case where Codeception Modules decide for themselves how they can be extended? So, I / someone should make PR for the documentation on Codeception? |
I think so yes. But I'd still like to make sure that your specific case can actually be solved using composition; or if it requires other changes to the Yii2 module. |
(apologies if the title is too convoluted!)
So, one of the changes introduced between 1.1.10 & 1.1.11 is that the Module class is made
final
. Seesrc/Codeception/Module/Yii2.php
, line 168/169.Craft CMS is a CMS that is built on Yii2. For its testing API it uses Codeception and this Codeception yii2 module. Amongst others it extends this module: https://github.com/craftcms/cms/blob/5.x/src/test/Craft.php#L65
And of course extending a final class is not possible, so our test suites now throw an error:
The documentation of Codeception 5 mentions the following when it comes to extending a Module: https://codeception.com/docs/ModulesAndHelpers#Extending-a-Module. So I think this means that the
Codeception\Module\Yii2
class should not be final.I'm submitting this more as a question, because I might be missing the context for which the change to
final
was made.The text was updated successfully, but these errors were encountered: