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

test: fix test

This commit is contained in:
jaulz 2024-11-05 07:52:43 +00:00
parent ee9e6397e3
commit ad10713482

View file

@ -162,7 +162,7 @@ class JobPipelineTest extends TestCase
} }
])->send(function (TestEvent $event) { ])->send(function (TestEvent $event) {
return $event->testModel; return $event->testModel;
})->toListener()); })->shouldBeQueued(false)->toListener());
event(new TestEvent(new TestModel())); event(new TestEvent(new TestModel()));
@ -172,25 +172,17 @@ class JobPipelineTest extends TestCase
/** @test */ /** @test */
public function failures_in_closures_will_throw_correctly() public function failures_in_closures_will_throw_correctly()
{ {
$passes = true; $this->expectExceptionMessage('foobar');
Event::listen(TestEvent::class, JobPipeline::make([ Event::listen(TestEvent::class, JobPipeline::make([
function () use (&$passes) { function () {
try { throw new Exception('foobar');
throw new Exception('foobar');
} catch (Exception) {
$passes = false;
}
} }
])->send(function (TestEvent $event) { ])->send(function (TestEvent $event) {
return $this->valuestore; return $this->valuestore;
})->toListener()); })->toListener());
event(new TestEvent(new TestModel())); event(new TestEvent(new TestModel()));
sleep(1);
$this->assertFalse($passes);
} }
} }