createFile() public method

Create a new file.
public createFile ( string $path, string $contents = '', string $visibility = Filesystem::VISIBILITY_DEFAULT )
$path string
$contents string
$visibility string
コード例 #1
0
 /**
  *
  */
 public function testApiCreateFile_ThrowsException_WhenLegueWriteThrowsException()
 {
     $path = 'path';
     $contents = 'contents';
     $visibility = 'visibility';
     $expected = new Exception();
     $ex = null;
     $this->expect('put', [$path, $contents, $this->prepareConfig($visibility)])->willThrow($expected);
     try {
         $this->fs->createFile($path, $contents, $visibility);
     } catch (Exception $ex) {
     }
     $this->assertInstanceOf(WriteException::class, $ex);
     $this->assertSame($expected, $ex->getPrevious());
 }