Exemplo n.º 1
0
 /**
  * Inits processor and run preprocessor tasks if any
  *
  * @return void
  */
 protected function _initProcessor()
 {
     $this->_processor = Processor::getInstance();
     $paramPath = $this->_input->getArgument('path');
     // If path cannot be loaded, exit immediately
     if (!$paramPath) {
         return;
     }
     $path = new Path($paramPath, getcwd(), $this->_baseDirectory);
     if ($path->isValid()) {
         $this->_processor->setPath($path);
         if (!$this->_input->getOption('ignore-manifest')) {
             $this->_manifest->load($path);
             // Check if we've some preprocessor task to complete
             $this->_runProcessors(Processor::PRE_PROCESSORS);
         }
     }
 }
Exemplo n.º 2
0
 /**
  * @test
  * @covers ::isValidForPath
  */
 public function isValidForPath_should_return_true_when_allowed_groups_contains_current_group()
 {
     $manifest = new Manifest();
     $manifest->load($this->_getPath());
     $xml = new \DOMDocument();
     $xml->loadXML('<config><allowed_groups><group>prep</group></allowed_groups></config>');
     $result = $manifest->isValidForPath($xml, $this->_getPath());
     $this->assertTrue($result);
 }