Having a fast test suite can be just as important as having a fast application. As a developer, getting feedback quickly about the state of your code allows for a much quicker development turnaround. Here we are going to run through some tips you can implement today to make your tests run faster.Read more…
I thought it might help people new to the Laravel framework and testing, to walk through how to test length validation. When I say length validation, I mean the constraints of length that you might want to put on a string field.
For example, let’s say that we wanted to limit the length of a user’s real name to 50 characters; or if we restrict the email address to the database column length of 255. Along with the database constraints, we should add validation constraints to... Read more…
When you start working on a new feature, it is wise to plan out not only how it is expected to work, but what happens if something fails. Taking the time up front to anticipate failure is a quality of a great developer. We can use Laravel’s real-time facades to easily mock exceptions for things like HTTP client failure state. Learn how to start using real-time facades to test your implementation’s failure state.Read more…
When writing tests in Lumen, I recently discovered that the `route()` helper doesn’t work with tests out-of-the-box. I prefer to define named routes and make requests against them in my tests. In this post, learn how to bootstrap the request instance in order to use named routes in your Lumen tests.Read more…
Tests Watcher is a continuous testing dashboard made with Laravel by Antonio Carlos Ribeiro. According to the author, think of it as “Laravel Horizon for all of your tests.” It supports PHPUnit, Laravel Dusk, PhpSpec, Behat, Atoum, and any test framework executed in the terminal. This project isn’t only for PHP, you could integrate this dashboard with Jest or Rake tests, for example.Read more…
Vue.js now has an official unit testing library for testing Vue applications. It provides methods for unit testing your components. A 1.0 beta version shipped Monday, as well as an official guide to help you get started with standard tips, using test runners, and testing components which use Vuex (centralized state management for Vue).Read more…
Writing HTTP tests in Laravel is so easy and convenient, and I find myself doing more testing at this level. In this post, I’d like to demonstrate a practical example of testing a middleware using HTTP tests.Read more…
Join the weekly newsletter and never miss out on new tips, tutorials, and more.
- Mid / Sen. Software Engineer
- Remote PHP / Laravel Developer
- Senior PHP/Laravel Developer: Your Dream Work Environment
iPhone Photography School
- Senior Laravel Developer
- PHP Developer
- Senior Laravel Developer (Canada and India)
London, Ontario, Canada
Factory Bucket Inc.
- Laravel, PHP, PostgreSQL, Neo4J Developer
Pune, India (intern in Denver, CO)