Unit Testing – Introduction

“Code without tests is bad code. It doesn’t matter how well written it is; it doesn’t matter how pretty or object-oriented or well-encapsulated it is. With tests, we can change the behavior of our code quickly and verifiably. Without them, we really don’t know if our code is getting better or worse.” – Michael C. Feathers

Do you want to banish the evil spirit of terror? Or maybe you just want to be sure that you are producing a code without errors? For whatever reasons you are here I will give you a few more to stay with me and catch up with test framework in Magento 2.

Continue reading “Unit Testing – Introduction”

Composer: Scripts

“Hook me up
I’m reaching out for you, come on
Hook me up
I know you can do it, come on, take me on” – Bon Jovi

We all use composer to manage libraries for our apps. Usually we build composer.json file, install dependencies and eventually update them later. These are common and repetitive tasks but composer of course has much more to offer.

Continue reading “Composer: Scripts”

Constructors signature and LSP

“Objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program.” – Barbara Liskov

From time to time we all encounter oddity of the language that we use and the feeling of strangeness of course is simply caused by some gaps in our knowledge. When I was building some CLI commands for my Magento’s module I found that I must extend Symfony’s Command class. Nihil novi sub sole, however I also wanted to inject my custom ThemeInstaller class to delegate some responsibilities. Then I realized that I will not be able to do that…

Continue reading “Constructors signature and LSP”

The Beginning!

“The beginning is the most important part of the work.” – Plato

This is where I should start and this is a good moment to greet you. I begin my journey here and I’d like to take you with me. I feel like I was drifting on the sea of complexity for a long time and I want to share this feeling with you, nevertheless I am sure that you already know what it is like to stand face to face with fear… or Magento.

Continue reading “The Beginning!”