Tag Testing

Tag Testing RSS 2.0 Feed

QUnit with Grunt - A minimal JavaScript unittest example

Writing testable JavaScript code is in my eyes sometimes more complex as writing testable code in other programming languages. JavaScript has it roots in the web development and the normal environment for JavaScript code was the web browser. There was always the global document object. Node.js has changed this assumption.

Continue reading ...

PHPUnit compare generated PDF files with Imagick

Sometimes it is necessary to compare a generated PDF file with a given one in PHP. Just to check with one PHPUnit test that your PDF generation works the expected way. But pretty often generated PDF files are equal, but there content isn't the same. For example if you use FPDF the following assertion can fail if the files have different meta data.

$pdfContent1 = file_get_contents('path_to_pdf1');
$pdfContent2 = file_get_contents('path_to_pdf2');
$this->assertSame($pdfContent1, $pdfContent2);

Continue reading ...

Testing the quality of Lesti_Fpc

Lesti_Fpc has changed in the last month. Some of the changes are part of the code quality. Today I would like to present the tools, that I use to raise the quality of my Magento extension.

Continue reading ...

Simulate Mouse Clicks in QUnit on Coordinates

I made a small plugin for jQuery to get the color of an image pixel. It's called broilerjs. I wanted to test the plugin via QUnit, a JavaScript Unit Testing framework. But I could not find a possibility to simulate a mouse click on special x and y coordinates. But in the end it was very easy.

Continue reading ...

Different Build Scripts for different Commits in Gitlab Ci

Using GitLab Continuous Integration is pretty cool for testing. You just need to edit the build script under Build settings and can run your tests. For example PHPUnit tests. Your tests will run and you will see if you get a success or a fail. All fine.


Continue reading ...