put() public method

put content to file
Since: 3.0.0
public put ( string $path = null, string $content = null )
$path string name of the path
$content string content of the file
Ejemplo n.º 1
0
 /**
  * setUpBeforeClass
  *
  * @since 3.0.0
  */
 public static function setUpBeforeClass()
 {
     $rootDirectory = new Directory();
     $rootDirectory->init('.');
     $rootDirectory->create('.restore');
     $rootDirectory->put('.restore/test.sql', '/* test */');
 }
Ejemplo n.º 2
0
 /**
  * testPut
  *
  * @since 3.0.0
  *
  * @param string $path
  * @param array $putArray
  * @param string $expect
  *
  * @dataProvider providerPut
  */
 public function testPut($path = null, $putArray = [], $expect = null)
 {
     /* setup */
     $directory = new Directory();
     $directory->init(Stream::url($path));
     $directory->put($putArray[0], $putArray[1]);
     /* actual */
     $actual = file_get_contents(Stream::url($path . '/' . $putArray[0]));
     /* compare */
     $this->assertEquals($expect, $actual);
 }