Posts tagged with testing
Controlling the flow of time in your tests
Our test-time package makes writing tests, for code that makes its decisions based on the current time, very easy.
Here's how we use the package for some tests in Mailcoach.
Join thousands of developers
Every two weeks, I share practical tips, tutorials, and behind-the-scenes insights from maintaining 300+ open source packages.
No spam. Unsubscribe anytime. You can also follow me on X.
How to Unit Test a Laravel API with the Pest Framework
– www.twilio.com - submitted by Nuno Maduro
In this tutorial, we’ll be looking at how to get started using Pest in a Laravel project. Using the test-driven approach, we’ll be building a simple to-do application that allows you to create, edit, update and delete tasks.
Read more [www.twilio.com]
Setup MailHog with Laravel Valet
– ryangjchandler.co.uk - submitted by Ryan Chandler
Testing emails can be a pain. Luckily, there are plenty of tools out there that can make the process a lot easier. Let me show you how to setup MailHog, a local development tool for testing emails.
Read more [ryangjchandler.co.uk]
Making our Laravel test suite in Oh Dear ready for parallel testing
Using the new parallel testing feature that recently landed in Laravel, we managed to run the Oh Dear testsuite about four times faster.
Read more [ohdear.app]
A mail driver to quickly preview mail in Laravel apps
Using our laravel-mail-preview package, you can quickly display mails that are sent by your Laravel application in your browser.
Today, we've released v5 of the package. In this blog post, I'd like to tell you all about it.
Contract Tests
In this post, Kai takes a look at how you can write tests to ensure consistent behavior across all implementations of an interface.
Read more [www.kai-sassnowski.com]
Configuration precedence when testing Laravel
Here's how Laravel loads config values.
Read more [jasonmccreary.me]
Finding Slow Tests in PHPUnit 9
When your unit test suite gets larger, it can take quite a long time. One of the many ways to speed this up is to hunt down and fix slow tests. Let’s use PHPUnit’s test listeners to do just that.
Read more [www.aaronsaray.com]
Moving PHP and Laravel tests from Travis CI to GitHub Actions
Earlier this year, Travis CI announced a new pricing model that effectively ends the generous open-source offering they had for many years. It seems that, even though there were some plans to provide free resources for OSS projects in the future, all activity for OSS projects has stopped.
At our company, we create a lot of open-source projects and packages. Beginning 2020, we already moved most of our stuff to GitHub actions.
Sure, you can read the GitHub actions docs to start learning the possibilities, but in my experience, it might be better to see some examples of practical uses cases. Here are some interesting links that might help you get started with GitHub actions.
How the Pest PhpStorm Plugin Will Improve Your Testing Workflow
– blog.jetbrains.com - submitted by Nuno Maduro
Users of Pest will be happy to know there's now a nice plugin to improves integration in PhpStorm.
Read more [blog.jetbrains.com]
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]
Compiling and test driving PHP 8
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.
Nested States in Laravel 8 Database Factories
– 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]
Faking Laravel's current date in Cypress end-to-end tests
– 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]
Supporting and testing using multiple Laravel and PHP versions
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]
PEST v0.3 is now released
– 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]
Using pcov instead of XDebug for code coverage
Michael Dyrynda explains why and how you should install pcov
Read more [dyrynda.com.au]
Snapshot through the heart
Emma Febre wrote an interesting piece on the pittfals of using snapshots.
Read more [madewithlove.com]
Meetup time: discovering Laravel Workbench and Exploring Pest 0.2
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