1
0
Fork 0
mirror of https://github.com/archtechx/jobpipeline.git synced 2025-12-12 15:34:04 +00:00

test: add test

This commit is contained in:
jaulz 2024-11-08 07:50:59 +00:00
parent f1f82aa5d9
commit 962562c97e

View file

@ -2,6 +2,7 @@
namespace Stancl\JobPipeline\Tests;
use Exception;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Queue;
@ -193,6 +194,22 @@ class JobPipelineTest extends TestCase
$this->assertTrue($passes);
}
/** @test */
public function failures_in_closures_will_throw_correctly()
{
$this->expectExceptionMessage('foobar');
Event::listen(TestEvent::class, JobPipeline::make([
function () {
throw new Exception('foobar');
}
])->send(function (TestEvent $event) {
return $this->valuestore;
})->shouldBeQueued(false)->toListener());
event(new TestEvent(new TestModel()));
}
}
class FooJob