Skip to content

Commit

Permalink
fix queue testing implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonnx committed May 9, 2024
1 parent 0da2b6b commit 6148515
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/LaravelLogTest/Console/Commands/LogTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace LaravelLogTest\Console\Commands;

use Illuminate\Console\Command;
use Illuminate\Support\Facades\Log;

class LogTest extends Command
{
Expand Down Expand Up @@ -38,7 +39,7 @@ public function __construct()
*/
public function handle()
{
throw new \Exception('TEST: uncaught exception thrown in command');
Log::warning('test');
}


Expand Down
2 changes: 2 additions & 0 deletions src/LaravelLogTest/Console/Commands/LogTestCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use App\Jobs\ThrowUncaughtException;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Log;

class LogTestCommand extends Command
{
Expand Down Expand Up @@ -39,6 +40,7 @@ public function __construct()
*/
public function handle()
{
Log::warning('TEST: log warning statement called directly in command');
throw new \Exception('TEST: uncaught exception thrown in command');
}

Expand Down
2 changes: 1 addition & 1 deletion src/LaravelLogTest/Console/Commands/LogTestQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace LaravelLogTest\Console\Commands;

use Illuminate\Console\Command;
use LaravelLogTest\Jobs\ThrowUncaughtException;
use \LaravelLogTest\Jobs\ThrowUncaughtException;

class LogTestQueue extends Command
{
Expand Down
2 changes: 2 additions & 0 deletions src/LaravelLogTest/Jobs/ThrowUncaughtException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log;

class ThrowUncaughtException implements ShouldQueue
{
Expand All @@ -28,6 +29,7 @@ public function __construct()
*/
public function handle(): void
{
Log::warning('TEST: log warning statement called directly in queue job');
throw new \Exception('TEST: uncaught exception thrown in queue job');
}
}

0 comments on commit 6148515

Please sign in to comment.