public function testApiFactory_ThrowsException_WhenModelThrowsException()
{
$this->setExpectedException(WriteException::class);
$container = $this->createContainer();
$alias = 'alias';
$callback = function () {
};
$this->container->add($alias, $callback)->willThrow(new Exception())->shouldBeCalledTimes(1);
$container->factory($alias, $callback);
}