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