public function testCodeWriterCalledIfSourceNotNull()
 {
     $class = new cfhCompile_Class_Reflection($this);
     $cr = new cfhCompile_ClassRegistry();
     $w = $this->getMock('cfhCompile_CodeWriter_WriteStrategy_Interface');
     $w->expects($this->once())->method('begin');
     $w->expects($this->once())->method('write')->with($this->equalTo($class), $this->equalTo('/* source code */'), $this->equalTo($cr));
     $w->expects($this->once())->method('commit');
     $rs = $this->getMock('cfhCompile_CodeReader_ReadStrategy_Interface');
     $rs->expects($this->once())->method('getSourceCode')->will($this->returnValue('/* source code */'));
     $r = new cfhCompile_CodeReader();
     $r->setReadStrategy($rs);
     $i = new cfhCompile_ClassIterator_Manual();
     $i->attach($class);
     $c = new cfhCompile_Compiler();
     $c->setCodeReader($r);
     $c->setCodeWriter($w);
     $c->setClassIterator($i);
     $c->setClassRegistry($cr);
     $c->compile();
 }