Skip to content

Commit

Permalink
Fixing LogSqlQueryTest for new App::runningInConsole() check
Browse files Browse the repository at this point in the history
Revert readonly SqlLogger from fea4d76
  • Loading branch information
onlime committed Sep 12, 2024
1 parent ffba7f7 commit 169af80
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/SqlLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\DB;

readonly class SqlLogger
class SqlLogger
{
/**
* SqlLogger constructor.
Expand Down
3 changes: 3 additions & 0 deletions tests/Unit/LogSqlQueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Illuminate\Console\Events\CommandFinished;
use Illuminate\Foundation\Http\Events\RequestHandled;
use Illuminate\Support\Facades\App;
use Onlime\LaravelSqlReporter\Listeners\LogSqlQuery;
use Onlime\LaravelSqlReporter\SqlLogger;

Expand All @@ -17,6 +18,8 @@
});

it('can handle the request handled event', function () {
App::shouldReceive('runningInConsole')->andReturn(false);

$listener = new LogSqlQuery($this->logger);
$listener->handle(Mockery::mock(RequestHandled::class));

Expand Down

0 comments on commit 169af80

Please sign in to comment.