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:
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) {
|
])->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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue