Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Unit Testing a Plugin
businessdad
MVP
Hi all,
I'm developing my third plugin for Vanilla and I was wondering if there's a way to use PHPUnit (or similar) to run Unit Tests on them, as it would save me quite a bit of time.
Thanks in advance for the replies.
Tagged:
0
Answers
We don't really have that kind of integration. If I were to do it though I'd try unit testing with curl requests.
I actually found a way to do it, although I have to start implementing my tests and see if they really work as expected. Testing with CURL would not be optimal, as I have to test every unit by itself (e.g. a "unit" could be a single class method), without necessarily using an http request.
If this could be useful to anyone, I'll post my findings and document my method.
My shop | About Me
@businessdad we have a wiki going at the moment at http://vanillawiki.homebrewforums.net/index.php/Main_Page maybe an idea to post it there? Or both here and there?
There was an error rendering this rich post.
@UnderDog I think the wiki would probably be the best place. I'll start writing something down once I'm sure my method actually makes sense.
My shop | About Me
@businessdad feel free to start capturing some of your thoughts on the wiki, i can't think of a better way to get immediate feedback on the concept and implementation. We can clearly mark it as "under-development" if needed.
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained