function testCreateTestClassesWithSomeClassesAlreadyIncluded()
 {
     $foo = new GeneratedTestClass();
     $bar = new GeneratedTestClass();
     file_put_contents($foo_file = LIMB_VAR_DIR . '/foo.php', $foo->generate());
     file_put_contents($bar_file = LIMB_VAR_DIR . '/bar.php', "<?php\n" . "require_once('{$foo_file}');\n" . $bar->generateClass() . "\n?>");
     $node_bar = new lmbTestTreeFileNode(LIMB_VAR_DIR . '/bar.php');
     $this->_runNodeAndAssertOutput($node_bar, $bar->getOutput());
     $node_foo = new lmbTestTreeFileNode(LIMB_VAR_DIR . '/foo.php');
     $this->_runNodeAndAssertOutput($node_foo, $foo->getOutput());
 }
Esempio n. 2
0
 function _createTestCase($file, $body = '%class%')
 {
     $this->_createDirForFile($file);
     $generated = new GeneratedTestClass($body);
     file_put_contents($file, "<?php\n" . $generated->generateClass() . "\n?>");
     return $generated;
 }