Ray is a great companion when debugging a test. However, in busy integration tests it can be hard to find out which logs matter and which don’t.

class CommentTest extends TestCase { public function test_a_user_can_post_a_comment(): void { ray()->clearScreen()->disable(); // Arrange ray()->enable(); // Act // Assert }} ray()->clearScreen() clears the output in Ray to start with a clean slate.

After arranging the test, ray()->enable() turns Ray back on, and we act on our test subject.

class CommentTest extends TestCase { public function setUp(): void { parent::setUp(); ray()->clearScreen()->disable(); } public function test_a_user_can_post_a_comment(): void { // Arrange ray()->enable(); // Act // Assert }}
Newsletter

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

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners