From 01e0554452f4cc0b89c74e5971bc864d43f0a278 Mon Sep 17 00:00:00 2001 From: jstoone Date: Sun, 10 Jan 2021 03:21:22 +0100 Subject: [PATCH] Add missing return statement. --- src/Ray.php | 2 +- tests/RayTest.php | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Ray.php b/src/Ray.php index 3841d70..7bd1ac8 100644 --- a/src/Ray.php +++ b/src/Ray.php @@ -108,7 +108,7 @@ public function showQueries($callable = null): self public function queries($callable = null): self { - $this->showQueries($callable); + return $this->showQueries($callable); } public function stopShowingQueries(): self diff --git a/tests/RayTest.php b/tests/RayTest.php index 626a7c2..114ff0e 100644 --- a/tests/RayTest.php +++ b/tests/RayTest.php @@ -64,6 +64,16 @@ public function it_can_start_logging_queries() $this->assertCount(1, $this->client->sentPayloads()); } + /** @test */ + public function it_can_start_logging_queries_using_alias() + { + ray()->queries(); + + DB::table('users')->get('id'); + + $this->assertCount(1, $this->client->sentPayloads()); + } + /** @test */ public function it_can_stop_logging_queries() {