-
Notifications
You must be signed in to change notification settings - Fork 641
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
Unit testing framework #1485
Comments
To be able to test properly, you need to be able to mock dependencies. And to be able to do that, quite some code has to be changed to implement dependency injection. Is there a plan to implement this and make proper unit testing possible? |
Do you have more information on what we can expect in the 3.0 GA for this testing framework? We're adding unit, API, and end-to-end testing to several Craft plugins and client projects. What can we expect in this initial release? |
@yp28 not necessarily. In Yii2 you can override components, and thus mock them. |
@boboldehampsink I sure hope that's not where this is headed 😅 Edit: anyway, turns out 3.0 was released with hardly any unit tests. Is it still the plan to add this in the near future, @brandonkelly? |
@yp28 Its worrying enough that Craft itself doesn't have tests 😅 |
Will be interesting to see the impact of Yii2.1 also which changes routing, adds dependency injection, adds middleware, etc. Details here https://github.com/yiisoft/yii2/milestones/2.1.0 |
Here is a Craft 3 plugin that uses the Codeception testing framework and is able to mock services: https://github.com/nerds-and-company/schematic |
Still no news on that? Would love to be able to develop modules or plugins test driven :) |
I'm very interested in using Craft as an application development framework, but the lack of an officially-supported story for testing plugins and modules makes it a tough sell. |
As of Craft 3.2 BETA-1, there is now a formalized testing Framework for Craft. Based on Codeception with support for sites, modules and plugins in various testing styles. Formal announcement here Big +1 for @boboldehampsink for his help on this. |
No description provided.
The text was updated successfully, but these errors were encountered: