Posts

Showing posts with the label composer

Fast PHPUnit tests

Image
Testing your software is an important process. If you don't test, then you're falling behind your colleagues and cause a potential danger to your and your company's reputation and money. So, if you haven't started already, start now. Don't worry, it only looks confusing at first, but once you get used to it, you won't imagine working without testing. Your end-goal is to feel uncomfortable if you push untested code. Nonetheless, this post is about how to make PHPUnit tests faster. Since I'm mainly a Laravel developer, I will focus on this framework. However, everything can be easily adapted to use on other frameworks as well. It is nothing new or revolutionary, but I still sometimes see people running tests the hard and slow way. So here are the things you can do to speed up your tests. Use SQLite Many still use MySQL database for their tests. This is might look fine with a few tests, but as your application grows running your tests becomes a very l...

Faster composer

Image
Hey fellow coders! This short post is for PHP developers. We have a wonderful tool composer , which helps us manage our dependencies. However, we sometimes need to install the whole framework with many packages which might take quite some time. You are lucky if you did this before and have most of the packages in cache, but that is not always the case :) hirak/prestissimo package comes to the help! You install it globally and installation time will be reduced up to 10 times! Creating a new Laravel project without parallelisation and no cache: Doing the same with hirak/prestissimo installed: Easy to install and joy to use. Try it out :)

My .bash_aliases

Image
Hey, fellow developers! So this post is more for IT people, but for other I will explain what aliases are. Bash is a terminal shell - basically a framework which can interpret your commands, execute them and give the output. Bash is only one of shells like sh , zsh , fish , kzsh , tcsh , etc. Being a developer involves quite a lot of work with a terminal, thus typing many commands a day. Typing a command takes time. Moreover, when you have to type it many times in a row or in a short period of time, it might get really annoying (at least for me 🙂). However, there is a way to speed it up and ease the typing - aliases. Aliases allow you to name a certain longer command and run it next time just by typing the name. So without further due, here is my list current aliases: Docker alias dr="docker-compose run" alias de="docker-compose exec" alias db="docker-compose build" Composer alias c='composer' alias t='c test'  - ...