Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

Pest Architecture Testing

Premium
2 min read

While debugging your Laravel application, you often use functions like dd(), dump(), etc. Architecture testing in Pest may help you scan the code before pushing to the repository, to ensure these functions don't exist anymore.

This is just one use-case. The architecture plugin allows you to check, for example, that only Enum files are in the specified folders.

Let's take a look at a practical example.

First, let's create a test.

php artisan make:test ArchTest

Let's check for debugging calls.

tests/Feature/ArchTest.php:

arch('No debugging calls are used')
->expect(['dd', 'dump'])
->not->toBeUsed();

If any debugging calls are left, we will...

The Full Lesson is Only for Premium Members

Want to access all of our courses? (29 h 14 min)

You also get:

54 courses
Premium tutorials
Access to repositories
Private Discord
Get Premium for $129/year or $29/month

Already a member? Login here

Comments & Discussion

No comments yet…