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