public function testApiWrite_ThrowsException_WhenModelPutThrowsException()
{
$path = 'path';
$contents = 'contents';
$expected = new Exception();
$ex = null;
$this->expect('update', [$path, $contents])->willThrow($expected);
try {
$this->fs->write($path, $contents);
} catch (Exception $ex) {
}
$this->assertInstanceOf(WriteException::class, $ex);
$this->assertSame($expected, $ex->getPrevious());
}