Kraken\_Unit\Util\Factory\FactoryPluginTest::testApiRegisterPlugin_ThrowsException_WhenRegisterThrows PHP Method

testApiRegisterPlugin_ThrowsException_WhenRegisterThrows() public method

    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());
    }