Exemplo n.º 1
0
Arquivo: Dir.php Projeto: jasny/Q
 /**
  * Class constructor
  * 
  * @param string $path
  * @param array  $content
  */
 public function __construct($path, $content = null)
 {
     parent::__construct($path);
     if (isset($content)) {
         $this->content = $content;
     }
     if ($path == '/tmp/q-config_dirtest-31e4649e807c8cadf222ee2428fee1c1/dir1') {
         var_dump($this->content);
         exit;
     }
     if (!is_dir($this->_path)) {
         throw new PHPUnit_Framework_SkippedTestError("Can't use Config_Mock_Dir object: '{$this->_path} does not exist");
     }
     foreach ($this->content as $file => $sub) {
         if ($sub == 0) {
             touch("{$this->_path}/{$file}");
         } else {
             mkdir("{$this->_path}/{$file}");
         }
     }
 }