Ejemplo n.º 1
0
 /**
  * Tests whether an execute call will yield the desired results.
  *
  * @return void
  */
 public function testExecute()
 {
     DocBlox_Core_Abstract::config()->transformations = array();
     $this->fixture = new DocBlox_Transformer();
     // when nothing is added; this mock should not be invoked
     $transformation = $this->getMock('DocBlox_Transformer_Transformation', array('execute'), array($this->fixture, '', 'Xsl', '', ''));
     $transformation->expects($this->never())->method('execute');
     $this->fixture->execute();
     // when we add this mock; we expect it to be invoked
     $transformation = $this->getMock('DocBlox_Transformer_Transformation', array('execute'), array($this->fixture, '', 'Xsl', '', ''));
     $transformation->expects($this->once())->method('execute');
     $this->fixture->addTransformation($transformation);
     $this->fixture->execute();
 }