Unit testing tips by examples in PHP

In these times, the benefits of writing unit tests are huge. I think that most of the recently started projects contain any unit tests. In enterprise applications with a lot of business logic, unit tests are the most important tests, because they are fast and can us instantly assure that our implementation is correct. However, I often see a problem with good tests in projects, though these tests’ benefits are only huge when you have good unit tests. So in these examples, I will try to share some tips on what to do to write good unit tests.

Read More

Docker hangs during build

Yesterday I had a strange problem with Docker during a build process. I use Linux Mint. I didn’t have enough space at the main system directory /. By default, Docker saves all data (images, volumes, etc.) in /var/lib/docker. Firstly I wanted to move this directory to the /home, but unfortunately, there was probably a problem with encryption, and Docker’s daemon couldn’t start properly. The second option was to move the directory to a hdd drive. But it also wasn’t a piece of cake (just Linux user normal day 😀 ).  

Read More

Circuit Breaker

In most systems, we use remote calls. Many factors may have an impact on these remote calls e.g. network latency, server availability and so on. So we should assume that something can go wrong. These calls can be potential bottlenecks, we don’t want user waiting for the response from the server very long, because external API is very slow or not available. Also if we have a few services which communicate with each other we shouldn’t aggravate the situation when one of them has too much traffic and slow down significantly. So how to do it correctly?

Read More