6

Is it possible to implement PHPUnit into Craft CMS? If so, where can I find a good explanation or tutorial? I already tried a Github link for a plugin (testing the plugin).

But I am new to both but really want to TDD the plugins. Any example pages or a quick guide would be great!

3

There is a good example of testing with PHPUnit in a Craft plugin here: https://github.com/selvinortiz/craft.loath and an example on how to stub out the global craft() class here: Stub out the global craft() object for PHPUnit tests

Note that testing in Craft should be a lot easier/convenient in the upcoming Craft 3.

1
  • 4
    In the upcoming Craft 3, it would be great if there came a section where Craft 3 and PHPUnit had a nice tutorial for beginners to write good plugins? Anyway thanks for the answer! – Bram B Aug 12 '16 at 12:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.