createParentDirectory() public method

Example #1
0
 public function testCreateParentDirectory()
 {
     $this->if($path = new testedClass('/a/b', '/'))->and($adapter = new atoum\test\adapter())->and($adapter->file_exists = false)->and($adapter->mkdir = true)->and($path->setAdapter($adapter))->then->object($path->createParentDirectory())->isEqualTo($path)->adapter($adapter)->call('mkdir')->withArguments('/a', 0777, true)->once()->if($adapter->mkdir = false)->then->exception(function () use($path) {
         $path->createParentDirectory();
     })->isInstanceOf('mageekguy\\atoum\\fs\\path\\exception')->hasMessage('Unable to create directory \'/a\'')->if($adapter->file_exists = true)->and($this->resetAdapter($adapter))->then->object($path->createParentDirectory())->isEqualTo($path)->adapter($adapter)->call('mkdir')->never();
 }