public function testPostWrite()
 {
     $c = '/* source */';
     $cw = new cfhCompile_CodeWriter();
     $cr = new cfhCompile_ClassRegistry();
     $cl = new cfhCompile_Class_Reflection($this);
     $plugin = $this->getMock('cfhCompile_CodeWriter_Plugin_Abstract');
     $plugin->expects($this->once())->method('postWrite')->with($this->equalTo($cw), $this->equalTo($cl), $this->equalTo($c), $this->equalTo($cr));
     $b = new cfhCompile_CodeWriter_PluginBroker();
     $b->attach($plugin);
     $b->postWrite($cw, $cl, $c, $cr);
     $b->detach($plugin);
     $b->postWrite($cw, $cl, $c, $cr);
 }
Exemplo n.º 2
0
 /**
  * Write a class.
  *
  * @param cfhCompile_Class_Interface $class
  * @param String $sourceCode
  * @param cfhCompile_ClassRegistry $classRegistry
  */
 public function write(cfhCompile_Class_Interface $class, $sourceCode, cfhCompile_ClassRegistry $classRegistry)
 {
     $sourceCode = $this->plugin->preWrite($this, $class, $sourceCode, $classRegistry);
     $this->write->write($class, $sourceCode, $classRegistry);
     $this->plugin->postWrite($this, $class, $sourceCode, $classRegistry);
 }