mirror of
https://github.com/archtechx/jobpipeline.git
synced 2025-12-12 23:14:04 +00:00
test: fix test
This commit is contained in:
parent
ee9e6397e3
commit
ad10713482
1 changed files with 4 additions and 12 deletions
|
|
@ -162,7 +162,7 @@ class JobPipelineTest extends TestCase
|
|||
}
|
||||
])->send(function (TestEvent $event) {
|
||||
return $event->testModel;
|
||||
})->toListener());
|
||||
})->shouldBeQueued(false)->toListener());
|
||||
|
||||
event(new TestEvent(new TestModel()));
|
||||
|
||||
|
|
@ -172,25 +172,17 @@ class JobPipelineTest extends TestCase
|
|||
/** @test */
|
||||
public function failures_in_closures_will_throw_correctly()
|
||||
{
|
||||
$passes = true;
|
||||
$this->expectExceptionMessage('foobar');
|
||||
|
||||
Event::listen(TestEvent::class, JobPipeline::make([
|
||||
function () use (&$passes) {
|
||||
try {
|
||||
throw new Exception('foobar');
|
||||
} catch (Exception) {
|
||||
$passes = false;
|
||||
}
|
||||
function () {
|
||||
throw new Exception('foobar');
|
||||
}
|
||||
])->send(function (TestEvent $event) {
|
||||
return $this->valuestore;
|
||||
})->toListener());
|
||||
|
||||
event(new TestEvent(new TestModel()));
|
||||
|
||||
sleep(1);
|
||||
|
||||
$this->assertFalse($passes);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue