A few thoughts on testing:
- If you're used to PHPunit, then you might find Test::Class to be analogous.
- However, if you're not going to use the different features of
Test::Class
(namely: being able to subclass your test classes), then you'll probably get a lot of mileage out of just usingTest::More
orTest::Most
.
Here's a quick rundown of the features that I see these three providing.
module | ships with perl | ease of use | like phpunit |
---|---|---|---|
Test::More | yes | high | no |
Test::Most | no | high | no |
Test::Class | no | medium | yes |
What's helpful to know is that Test::Class
provides a framework for structuring your tests in a JUnit-style fashion. Within your test classes, your individual testing-level assertions will be built up from functions provided by Test::More
, Test::Most
, and ilk.
If you can install new Perl libraries on your system, then I'd recommend getting started with Test::Most
. It's a convenient wrapper to export testing functions provided by Test::More
, Test::Exception
, and others. But if you really, really just want to get started, then just pick Test::More
.