write() public method

Overwrite existing file.
public write ( string $path, string $contents )
$path string
$contents string
コード例 #1
0
 /**
  *
  */
 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());
 }