Archive for the ‘unit testing’ Category

How to Write JavaScript-Style Test Watchers in PHP

Posted on: No Comments
I didn't start out writing tests for my code. Like many before and since, my "testing" was to write code and refresh the page. "Does it look right?", I'd ask myself. If I thought so, I'd move on. In fact, most of the jobs I've had have been with compan...

A Beginner’s Guide to Testing Functional JavaScript

Posted on: No Comments
Functional programming and testing. Maybe you've given them a try in isolation, but somehow you never made either a part of your regular practice. They may sound innocent by themselves, but together testing and functional programming can create an irre...

Upgrading Sylius the TDD Way: Exploring Behat

Posted on: No Comments
Last time, we developed some new features on top of Sylius' core to indicate which products and their variants are low on stock and need replenishing. Now, we move on to seeing our changes in the UI, which means we will need to do a bit of StoryBDD tes...

Upgrading Sylius the TDD Way: Exploring PhpSpec

The post on developing and testing new Sylius features was an introduction to the three types of tests that are used in Sylius - PHPUnit, Phpspec and Behat. In this part, we'll extend some core classes to indicate color-coded inventory status. First, w...

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 ...