Example #1
0
 function test_generacion_clase_archivo_con_codigo_previo()
 {
     $this->hijo = "hijo_codigo_previo";
     $this->padre = "padre_hijo_codigo_previo";
     $contenido = "<?php\n\t/*\n\t* \n\t*/\n\tclass clase_previa\n\t{\n\t\tfunction esta_es_una_funcion_previa()\n\t\t{\n\t\t\t//Esto trata de engaƱar al parser del archivo\n\t\t\t?><?php\n\t\t}\n\t}\n\n?>";
     //Se crea el archivo del hijo
     $this->crear_archivo_hijo($contenido);
     //Se genera la subclase
     $archivo = new toba_archivo_php($this->path_hijo());
     $padre = new toba_archivo_php($this->path_padre());
     $clase = new toba_clase_php($this->hijo, $archivo, $this->padre, $this->path_padre());
     $clase->set_meta_clase(new info_componente(array()));
     $clase->generar($this->generar_todo());
     //Se incluyen y se verifica que funcionan correctamente
     $padre->incluir();
     $archivo->incluir();
     $clase = new ReflectionClass($this->hijo);
     $this->AssertEqual($this->hijo, $clase->getName());
 }