public function testPostGetSourceCode()
 {
     $c = new cfhCompile_Class_Reflection($this);
     $cr = new cfhCompile_CodeReader();
     $code = '/* source code */';
     $plugin = $this->getMock('cfhCompile_CodeReader_Plugin_Abstract');
     $plugin->expects($this->once())->method('postGetSourceCode')->with($this->equalTo($cr), $this->equalTo($c), $this->equalTo($code))->will($this->returnValue($code));
     $b = new cfhCompile_CodeReader_PluginBroker();
     $b->attach($plugin);
     $this->assertSame($code, $b->postGetSourceCode($cr, $c, $code));
     $b->detach($plugin);
     $this->assertSame($code, $b->postGetSourceCode($cr, $c, $code));
 }
예제 #2
0
 /**
  * @param cfhCompile_CodeReader_Plugin_Interface $plugin
  */
 public function detachPlugin(cfhCompile_CodeReader_Plugin_Interface $plugin)
 {
     $this->plugin->detach($plugin);
 }