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 }}