[PEPr] Comment on Images::Image_Barcode2
| From: | Daniel O'Connor | Date: | Thu, 15 Jan 2009 13:11:38 +0000 |
| Subject: | [PEPr] Comment on Images::Image_Barcode2 | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-51430@lists.php.net to get a copy of this message | ||
Daniel O'Connor (http://pear.php.net/user/doconnor) has commented on the proposal for
Images::Image_Barcode2.
Comment:
1)
parent::setUp() isn't needed if you jsut extend
PHPUnit_Framework_TestCase:
protected function setUp()
{
parent::setUp();
$this->_Image_Barcode2 = new Image_Barcode2();
}
2) Image_Barcode2Test doesn't appear to have assertations in it - have I
missed something?
3) Consider 'agile documentation' for Image_Barcode2Test and others
http://www.phpunit.de/manual/3.1/en/other-uses-for-tests.html
or run current tests with
phpunit --testdocs
4) Though it breaks expectations from the previous package, I'd kind of
like to see only returning things from Image_Barcode2::draw(); and possibly
a 'render helper' type method which you can call to help with output to the
browser.
IE:
Image_Barcode2::displayToBrowser($image->draw());
More testable that way.
5) Test cases don't cover off execution paths which raise exceptions -
that would be nice to have going forward
6) I don't know if you want to go down this path; but pre-rendering a
number of images and creating test cases to ensure they render the same way
might be worth thinking about - will help you catch subtle breakages; but
also could record a lot of false positives (two systems use slightly
different image encoding libraries => false failure of test)
Otherwise, pretty neat and happy to have you on board.
Proposal information:
http://pear.php.net/pepr/pepr-proposal-show.php?id=584
--
Sent by PEPr, the automatic proposal system at http://pear.php.net