/** * */ public function testApiCopyFile_ThrowsException_WhenModelThrowsException() { $from = 'from'; $to = 'to'; $expected = new Exception(); $ex = null; $this->expect('copy', [$from, $to])->willThrow($expected); try { $this->fs->copyFile($from, $to); } catch (Exception $ex) { } $this->assertInstanceOf(WriteException::class, $ex); $this->assertSame($expected, $ex->getPrevious()); }