Ejemplo n.º 1
0
 public function testBuildProperties()
 {
     Xinc_Plugin_Repository::tearDown();
     Xinc_Plugin_Repository::getInstance()->registerPlugin(new Xinc_Plugin_Repos_Property());
     $workingdir = getcwd();
     $engine = new Xinc_Engine_Sunrise();
     $config = new Xinc_Project_Config($workingdir . '/test/resources/testProjectsPlugProperty.xml');
     $buildIterator = $engine->parseProjects($config->getProjects());
     $this->assertTrue($buildIterator instanceof Xinc_Build_Iterator, 'Should be of type Xinc_Build_Iterator');
     $build = $buildIterator->next();
     $engine->build($build);
     $original = $build->getProperties()->get('original');
     $compare = $build->getProperties()->get('compare');
     $this->assertEquals($original, $compare, 'Value should have been substituted and should be equal now: ' . $original . '!=' . $compare);
 }
Ejemplo n.º 2
0
 public function testExample()
 {
     Xinc_Plugin_Repository::tearDown();
     Xinc_Plugin_Repository::getInstance()->registerPlugin(new Xinc_Plugin_Repos_ModificationSet());
     Xinc_Plugin_Repository::getInstance()->registerPlugin(new Xinc_Plugin_Repos_Builder());
     Xinc_Plugin_Repository::getInstance()->registerPlugin(new Xinc_Plugin_Repos_ModificationSet_BuildAlways());
     Xinc_Plugin_Repository::getInstance()->registerPlugin(new Xinc_Plugin_Repos_Phing());
     $workingdir = getcwd();
     $engine = new Xinc_Engine_Sunrise();
     $config = new Xinc_Project_Config($workingdir . '/test/resources/testSunriseExampleProject.xml');
     $buildIterator = $engine->parseProjects($config->getProjects());
     $this->assertTrue($buildIterator instanceof Xinc_Build_Iterator, 'Should be of type Xinc_Build_Iterator');
     $build = $buildIterator->next();
     try {
         $build->build();
     } catch (Exception $e) {
         var_dump($e);
     }
     $this->assertTrue($build->getLastBuild()->getStatus() == Xinc_Build_Interface::PASSED, 'Build should pass');
 }