Esempio n. 1
0
 /**
  * Test getting a config-hash
  *
  * @depends testRun
  */
 public function testIsEnabled()
 {
     $this->assertTrue($this->_object->isEnabled());
     $oConfig = new \stdClass();
     $oConfig->test = 'cd /tmp';
     $oConfig->path = '/tmp';
     $oConfig->find = '*';
     $oConfig->enabled = false;
     $oProject = new \Testy\Project('test');
     $oProject->config($oConfig);
     $this->assertFalse($oProject->isEnabled());
     unset($oProject);
 }
Esempio n. 2
0
 /**
  * Add a project to watch
  *
  * @param  \Testy\Project $oProject
  *
  * @return $this
  */
 public function add(\Testy\Project $oProject)
 {
     $sName = $oProject->getName();
     if (empty($this->_aStack[$sName]) === true or $oProject->getProjectHash() !== $this->_aStack[$sName]->getProjectHash()) {
         if ($oProject->isEnabled() === true) {
             $this->_aStack[$sName] = $oProject;
             $oProject->notify(\notifyy\Notifyable::INFO, \Testy\Project\Builder::INFO);
         } elseif (empty($this->_aStack[$sName]) !== true) {
             unset($this->_aStack[$sName]);
         }
     }
     return $this;
 }