How to run over 30k tests in under 5 minutes
Paratest is an extension on top of PhpUnit that adds support for parallel testing. For our unit tests, we could just add Paratest and it works without any configuration!
Read more [blog.mollie.com]
Posts tagged with testing
Paratest is an extension on top of PhpUnit that adds support for parallel testing. For our unit tests, we could just add Paratest and it works without any configuration!
Read more [blog.mollie.com]
In this stream, my colleague Brent and I download the source of PHP 8 RC1, and test some of PHP 8's cool new features.
Brent and I are working on Front Line PHP, an ebook on cutting edge tactics in PHP 8, accompanied by videos and practical examples. Subscribe to our mailing list to get updates around this project.
Join 9,500+ smart developers
Get my monthly newsletter with what I learn from running Spatie, building Oh Dear, and maintaining 300+ open source packages. Practical takes on Laravel, PHP, and AI that you can actually use.
No spam. Unsubscribe anytime. You can also follow me on X.
"Always fresh, useful tips and articles. Carefully selected community content. My favorite newsletter, which I look forward to every time."
– stefanzweifel.io - submitted by Stefan Zweifel
A quick intro on how to use states for "nested" Database Factories. The examples covers the Models created by laravel/cashier-paddle package.
Read more [stefanzweifel.io]
– johnbraun.blog - submitted by John Braun
When writing an end-to-end test, it is tricky to force the application to use a certain (fake) date. In this post, John Braun shares his approach using a custom middleware to be able to write Cypress tests while your application state uses a specific (fake) date.
Read more [johnbraun.blog]
In this video you'll learn how add support for multiple PHP and Laravel versions, and how to run the tests against all combinations of Laravel and PHP.
Read more [spatie.be]
– nunomaduro.com - submitted by Nuno Maduro
PEST v0.3 features a new expectation API, a brand new PHPStorm plugin, and more.
Read more [nunomaduro.com]
Michael Dyrynda explains why and how you should install pcov
Read more [dyrynda.com.au]
Emma Febre wrote an interesting piece on the pittfals of using snapshots.
Read more [madewithlove.com]
Last week I held an online meetup. My two guests were JMac and Nuno Maduro. 00:00 Welcome 02:00 Exploring Laravel Workbench (JMac) 30:00 Introducing Pest 0.2 (Nuno Maduro) Show links Laravel Shift: https://laravelshift.com Pest: https://pestphp.com
It can be very hard to spot a false positive within a test. So how do you avoid them?
Read more [timacdonald.me]
In this video, you'll learn how to generate code coverage reports, and how to display them directly in PhpStorm.
This video is part of our Laravel Package Training video course. In that course, you'll learn how to create both framework agnostic and Laravel specific packages. We'll also source dive some popular Spatie packages together, so you can pick up some tricks we apply there.
Dave Marshall replies to a blogpost that Frank De Jonge published recently.
Read more [davedevelopment.co.uk]
In this video, Mohammed Said shares a nice, clean strategy for multitenancy in Laravel.
My buddy Nuno is working on an interesting project to improve the experience of writing tests.
Read more [nunomaduro.com]
– driesvints.com - submitted by Dries Vints
Here are three different ways you could test Laravel Cashier.
Read more [driesvints.com]
A must read by Frank de Jonghe on testing.
Read more [blog.frankdejonge.nl]
Recently we started using GitHub Actions to test all our packages. You can read more about our general setup in this blog post.
For most of the packages, this works great. However, some of our packages, such as Laravel Tags, use JSON functions that are not available in SQLite. Luckily it's straightforward to use a database like MySQL in GitHub Actions.
Have you every come across confusing if statements with complex conditionals such as this? I bet you did!
// please kill me 🤯 if (!(($this->shipping_country == "GB" || (strcmp($this-status, "Valid") !== 0)) {
To me, this is completely unreadable.
In the video below I show how I deal with this situation. Spoiler: add some tests around it and break the conditionals apart.
This video is part of the Mailcoach video course. It contains many more videos on how to write clear code. You can use this coupon code to get a nice discount of $10.
YES-I-WANT-TO-WRITE-READABLE-CODE
Sebastian Bergmann, creator of PHPUnit, walks us through some history and design decisions for PHPUnit.
Read more [thephp.cc]
Last week, my colleague Ruben and I released a package called spatie/docker, that makes it easy to spin up docker containers and execute commands on them. In this blog post, I'd like to introduce what you can do with it and why we built this.