Archive for the ‘unit testing’ Category

JavaScript Testing Tool Showdown: Sinon.js vs testdouble.js

Posted on: No Comments
When unit testing real-world code, there are many situations that make tests hard to write. How do you check if a function was called? How do you test an Ajax call? Or code using setTimeout? That's when you use test doubles — replacement code that ma...

Learning JavaScript Test-Driven Development by Example

Posted on: No Comments
You're probably already familiar with automated testing and its benefits. Having a set of tests for your application allows you to make changes to your code with confidence, knowing that the tests have your back should you break anything. It's possible...

Sylius and Cutting Your Teeth on TDD

Posted on: No Comments
Sylius is an e-commerce application / framework based on Symfony. It boasts 100% code coverage, which is impressive for a PHP application of that size. In this article, we are going to walk through the different kinds of tests available and try out so...

Testing Frenzy – Can We BDD Test the Units?

Posted on: No Comments
I'll be honest, I don't do much testing. When it's really necessary and I'm working on big enterprise projects, I do, but in general, my personal projects are usually one-man-army proofs of concept, or fixes on already tested apps. [author_more] We've ...

Re-Introducing Jenkins: Automated Testing with Pipelines

Posted on: No Comments
As our applications become more complex - with Composer dependencies, Webpack build scripts, and per-environment variables - we inevitably reach a point where testing all of these different intricacies becomes slow and laborious, especially when you're...

Testing PHP Code with Atoum – an Alternative to PHPUnit

Posted on: No Comments
If you’ve been around PHP for more than a little while, you’ve no doubt started to test your code. And if you ask anyone in the PHP space what to use for writing unit tests, likely the first answer that they’ll give you is PHPUnit. It’s the de ...

Hassle-Free Filesystem Operations during Testing? Yes Please!

Posted on: No Comments
When working with the filesystem in our tests suites, a big concern is cleaning up the temporary files after each test runs. However, if for any reason the test's execution is interrupted before the cleanup phase, further tests might fail, as the envir...

Testing Your Tests? Who Watches the Watchmen?

Posted on: No Comments
Regardless of whether you’re working for a big corporation, a startup, or just for yourself, unit testing is not only helpful, but often indispensable. We use unit tests to test our code, but what happens if our tests are wrong or incomplete? Wha...

An Overview of PHPUnit 5 – What’s New? What’s Coming?

It was January 2016 when the PHPUnit development team announced the release of PHPUnit 5.0. While several minor version have already been released since, PHPUnit's major version 5 has introduced several new functionalities and deprecated a few others...

Building a SparkPost Client: TDD with PhpUnit and Mockery

Posted on: No Comments
In a previous post, we looked at SparkPost (as an alternative to Mandrill), and explored a bit of the official PHP client. The official client handles a decent amount of work, but I got to thinking about what it would take to build a new client. The mo...