Exemple #1
0
 public function testForced()
 {
     // defaults to false
     $this->assertEquals(false, $this->fixture->isForced());
     $xml = new SimpleXMLElement('<project></project>');
     $xml->addAttribute('version', DocBlox_Core_Abstract::VERSION);
     $this->fixture->setExistingXml($xml->asXML());
     $this->assertEquals(false, $this->fixture->isForced());
     // if version differs, we force a rebuild
     $xml['version'] = DocBlox_Core_Abstract::VERSION . 'a';
     $this->fixture->setExistingXml($xml->asXML());
     $this->assertEquals(true, $this->fixture->isForced());
     // switching back should undo the force
     $xml['version'] = DocBlox_Core_Abstract::VERSION;
     $this->fixture->setExistingXml($xml->asXML());
     $this->assertEquals(false, $this->fixture->isForced());
     // manually setting forced should result in a force
     $this->fixture->setForced(true);
     $this->assertEquals(true, $this->fixture->isForced());
     $this->fixture->setForced(false);
     $this->assertEquals(false, $this->fixture->isForced());
 }