Skip to content

Commit

Permalink
tests: Test rejection handlers of rejected tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
yhabteab committed Jan 10, 2023
1 parent f3ed93c commit b607686
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/SchedulerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,4 +298,19 @@ public function testOneOffTasksRunOnlyOnce()
$this->assertEquals(1, $this->scheduler->countTimers());
$this->assertEquals(1, $this->scheduler->countPromises($task->getUuid()));
}

public function testAlreadyRejectedTaskErrorPropagation()
{
$this->expectNotToPerformAssertions();

// Won't work yet
$task = new PromiseBoundTask(Promise\reject(new TaskRejectedException()));
$task1 = new PromiseBoundTask(Promise\reject('Rejected!'));

$this->scheduler->schedule($task, new ImmediateDueFrequency());

$this->runAndStopEventLoop();

// Assert here
}
}

0 comments on commit b607686

Please sign in to comment.