Open CloCkWeRX opened 12 years ago
I'm not sure what to do? Wrap over the image* functions? Do not see the point. Remove duplicated code? But in some cases (Code39 and ean13, for example) the implementation of a lot different.
Well, there's no way to test the drivers at the moment; or to mock them out. If we created a simple
class ImageWriterererThingy {
public function setWidth();
public function setHeight();
public function drawRect();
public function drawString();
}
... then it's easy to do things like:
testShouldDrawThreeBlackBoxes
$mock = $this->getMock('ImageWriterererThingy');
$barcode = new ...
$barcode->setThinger($mock);
$mock->expects($this->times(3))
->method('drawRect')
->with(array('x', 'y', 'black'));
(don't stress, I'll pick this one up in abit, with some basic test coverage)
@CloCkWeRX Can you close issues when you resolved them?
There are lots of calls to code like
littered through the codebase.
Introduce an Image_Barcode2 wrapper which provides a quick OO abstraction layer on the functional calls.