Skip to main content
CF

Testing Laravel with PHPUnit

2h 42m 59s
English
Paid

Testing Laravel with PHPUnit is a 36-lesson 2 hours 42 minutes self-paced course by Spatie. Embark on a journey to master testing in a Laravel application with Brent as your guide.

Course facts

Lessons
36
Duration
2 hours 42 minutes
Level
All levels
Language
English
Updated
Instructor
Spatie
Price
Premium

Embark on a journey to master testing in a Laravel application with Brent as your guide. Whether you're a complete beginner or already have some experience, this course will refine your skills and enhance your testing capabilities. Learn essential techniques, tips, and tricks for effective and efficient testing with Laravel.

Getting Started with Laravel Testing

Welcome to the world of application testing! This course offers a comprehensive introduction to testing in Laravel, allowing you to seamlessly integrate automated testing into your development workflow. In just a few lessons, you'll gain the ability to test the key components of your application, strengthening your codebase and boosting your confidence in your deployments.

Why Choose PHPUnit?

For this course, we focus on PHPUnit, the default test runner for Laravel applications. PHPUnit is widely adopted across the Laravel community, making it an essential tool for any developer looking to build reliable and maintainable applications. Through this course, you'll learn how to effectively utilize PHPUnit to write robust test suites for your Laravel projects.

Exploring Alternative Test Runners

Although PHPUnit is the standard, Pest is emerging as a promising alternative. This newer test runner offers a more concise and expressive syntax, which might appeal to developers seeking a different approach. If you're interested in exploring Pest further, consider checking out our dedicated Pest course for Laravel testing. Both approaches share fundamental testing concepts, though the syntax may vary.

Course Highlights

  • Understand the basics of testing in Laravel
  • Master PHPUnit as the primary test runner
  • Gain valuable insights into best practices for writing tests
  • Explore alternative testing frameworks like Pest

Who teaches Testing Laravel with PHPUnit? Spatie

Spatie thumbnail

Spatie is a Belgian web-development agency and one of the most respected names in the Laravel ecosystem — the author of more than 350 open-source PHP / Laravel packages (Laravel Permission, Laravel Backup, Laravel Translatable, Laravel Image Optimizer, and many others) that anchor a substantial portion of working Laravel codebases. Spatie's paid course material extends the same depth into long-form video.

The CourseFlix listing carries two Spatie courses: Writing Readable PHP (the code-quality / readability discipline applied to modern PHP) and Testing Laravel with PHPUnit (the testing workflow for production Laravel applications).

Material is paid and aimed at PHP / Laravel developers ready to take code quality and testing as serious professional disciplines. For broader content, see CourseFlix's Laravel and PHP category pages.

What lessons are included in Testing Laravel with PHPUnit?

This is a demo lesson (10:00 remaining)

You can watch up to 10 minutes for free. Subscribe to unlock all 36 lessons in this course and access 10,000+ hours of premium content across all courses.

View Pricing
0:00
/
#1: Intro
All Course Lessons (36)
#Lesson TitleDurationAccess
1
Intro Demo
03:33
2
Our First Test
04:40
3
Using a Database
07:53
4
Using Factories
06:50
5
Factory Relations
03:43
6
Testing a Form
07:24
7
Authenticated Testing
03:31
8
JSON Assertion
07:26
9
Testing Fakes
03:46
10
Mocking
05:03
11
Handcrafted Mocks
03:44
12
Testing Tim
02:50
13
Middleware Tests
05:15
14
Validation in Depth
05:43
15
Validation Rule Testing
02:52
16
Testing File Uploads
03:17
17
Policy Testing
03:03
18
Policies Continued
02:42
19
The HTTP Facade
04:03
20
Testing Console Apps
03:36
21
Testing Blade Components
04:10
22
Testing Livewire
03:21
23
Browser Tests
07:03
24
Dusk in Depth
04:02
25
Custom Factories
06:55
26
Testing Job
05:38
27
Testing Exceptions
02:18
28
TDD
06:35
29
Testing Domain Code
06:32
30
Refactoring with Tests
04:22
31
Regression Testing
01:53
32
Snapshot Testing
03:32
33
Tests and CI
03:09
34
Configuring Databases
01:50
35
Parallel Testing
03:47
36
Data Providers
06:58
Unlock unlimited learning

Get instant access to all 35 lessons in this course, plus thousands of other premium courses. One subscription, unlimited knowledge.

Learn more about subscription

What courses are similar to Testing Laravel with PHPUnit?

More courses by Spatie

  • Writing Readable PHP thumbnailUpdated 2y ago

    Writing Readable PHP

    Learn how to write code that’s a joy to read for you, your co-workers, and future self. View high-quality videos on both clean coding and static analysis.
    2h 40m

Frequently asked questions

What are the prerequisites for this course?
Before enrolling in this course, you should have a basic understanding of PHP and Laravel. Familiarity with setting up a Laravel project and basic PHP syntax is recommended. The course is designed to accommodate both beginners and those with some experience in testing, so prior testing experience is not required.
What kind of projects or exercises will I build during the course?
Throughout the course, you will engage in a variety of testing exercises, such as creating database tests, testing authentication, and using JSON assertions. You'll learn to test file uploads, policies, and even console applications. These exercises are designed to strengthen your practical testing skills within a Laravel application.
Is this course suitable for someone new to testing?
Yes, this course is suitable for beginners. It offers a comprehensive introduction to testing in Laravel, starting from the basics like writing your first test, and gradually moving to more advanced topics like mocking, testing fakes, and testing domain code.
How does this course compare to others that focus on Pest for testing?
This course focuses on PHPUnit, the default test runner for Laravel, while Pest is a newer alternative known for its concise syntax. If you're interested in Pest, it would be beneficial to explore our dedicated Pest course. This course emphasizes techniques and practices specific to PHPUnit and its integration with Laravel.
What specific tools will I learn to use in this course?
The course primarily focuses on using PHPUnit as the test runner for writing and executing tests. You will also learn about related tools and practices such as using factories, JSON assertions, and testing with fakes and mocks. These are integral to creating a comprehensive test suite for Laravel applications.
What topics are not covered in this course?
While this course extensively covers testing with PHPUnit in Laravel, it does not focus on using Pest, which is an alternative test runner. Additionally, advanced topics like deploying Laravel applications or performance testing are outside the scope of this course.
How much time should I expect to dedicate to this course?
The course comprises 36 lessons, each designed to be concise and focused. The total runtime is not specified, but you should allocate time for engaging with each lesson and practicing the exercises. Expect to spend additional time outside of the lessons to fully grasp the concepts and apply them to your projects.