append() public method

Appends contents to file.
public append ( string $path, string $contents )
$path string
$contents string
コード例 #1
0
 /**
  *
  */
 public function testApiAppend_ThrowsException_WhenUpdateThrowsException()
 {
     $path = 'path';
     $write = 'write';
     $read = 'read';
     $expected = new Exception();
     $ex = null;
     $this->expect('read', [$path])->willReturn($read);
     $this->expect('update', [$path, $read . $write])->willThrow($expected);
     try {
         $this->fs->append($path, $write);
     } catch (Exception $ex) {
     }
     $this->assertInstanceOf(WriteException::class, $ex);
     $this->assertSame($expected, $ex->getPrevious());
 }