BDD, or Behavioural Driven Development, is a popular testing approach in many organizations and has a proven track record for uniting testing efforts across teams. Much like Domain Driven Design allows us to create a ubiquitous language for our code, BDD will enable us to have a ubiquitous language for our testing.

User::query()->count(), )->toEqual(0); post( route('register'), ['name' => 'test', 'email' => $email, 'password' => 'password'] )->assertRedirect(route('dashboard')); expect(

For our BDD tests, I will create an Integration directory under test, so that I have: Unit: Test-Driven Development Feature: Test-Driven Development Integration: Behavioral Driven Development

Bus::assertDispatched(ActivateUser::class); }); So you can see that this way of testing has advantages for your test suite and your team.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners