public function testApiRegisterPlugin_ThrowsException_WhenRegisterThrows()
{
$mock = $this->createCallableMock();
$mock->expects($this->once())->method('__invoke')->will($this->throwException($exp = new Exception('Error')));
$plugin = $this->createSupervisorPlugin($mock);
$supervisor = $this->createSupervisor();
$ex = null;
try {
$plugin->registerPlugin($supervisor);
} catch (Exception $ex) {
}
$this->assertInstanceOf(ExecutionException::class, $ex);
$this->assertSame($exp, $ex->getPrevious());
}