/** * */ public function testApiPrepend_ThrowsException_WhenUpdateThrowsException() { $path = 'path'; $write = 'write'; $read = 'read'; $expected = new Exception(); $ex = null; $this->expect('read', [$path])->willReturn($read); $this->expect('update', [$path, $write . $read])->willThrow($expected); try { $this->fs->prepend($path, $write); } catch (Exception $ex) { } $this->assertInstanceOf(WriteException::class, $ex); $this->assertSame($expected, $ex->getPrevious()); }