Skip to content

Commit 169af80

Browse files
committed
Fixing LogSqlQueryTest for new App::runningInConsole() check
Revert readonly SqlLogger from fea4d76
1 parent ffba7f7 commit 169af80

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/SqlLogger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Illuminate\Support\Collection;
66
use Illuminate\Support\Facades\DB;
77

8-
readonly class SqlLogger
8+
class SqlLogger
99
{
1010
/**
1111
* SqlLogger constructor.

tests/Unit/LogSqlQueryTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
use Illuminate\Console\Events\CommandFinished;
44
use Illuminate\Foundation\Http\Events\RequestHandled;
5+
use Illuminate\Support\Facades\App;
56
use Onlime\LaravelSqlReporter\Listeners\LogSqlQuery;
67
use Onlime\LaravelSqlReporter\SqlLogger;
78

@@ -17,6 +18,8 @@
1718
});
1819

1920
it('can handle the request handled event', function () {
21+
App::shouldReceive('runningInConsole')->andReturn(false);
22+
2023
$listener = new LogSqlQuery($this->logger);
2124
$listener->handle(Mockery::mock(RequestHandled::class));
2225

0 commit comments

Comments
 (0)