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

businessdadbusinessdad Stealth contributor MVP
edited March 2012 in Vanilla 2.0 - 2.8

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.

Answers

  • ToddTodd Chief Product Officer Vanilla Staff

    We don't really have that kind of integration. If I were to do it though I'd try unit testing with curl requests.

  • businessdadbusinessdad Stealth contributor MVP

    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.

  • @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.

  • businessdadbusinessdad Stealth contributor MVP

    @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. :)

  • hbfhbf wiki guy? MVP

    businessdad said:
    @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. :)

    @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.

Sign In or Register to comment.