function testNotAGlobMatch() { mkdir(LIMB_VAR_DIR . '/a'); $test1 = new GeneratedTestClass(); $test2 = new GeneratedTestClass(); file_put_contents(LIMB_VAR_DIR . '/a/bar_test.php', $test1->generate()); file_put_contents(LIMB_VAR_DIR . '/a/foo_test.php', $test2->generate()); $root_node = new lmbTestTreeGlobNode(LIMB_VAR_DIR . '/a'); $this->_runNodeAndAssertOutput($root_node, $test1->getOutput() . $test2->getOutput()); }
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()); }
function testParentFixturesAreExecuted() { mkdir($this->var_dir . '/a'); mkdir($this->var_dir . '/a/b'); file_put_contents($this->var_dir . '/a/.setup.php', '<?php echo "setup"; ?>'); file_put_contents($this->var_dir . '/a/.teardown.php', '<?php echo "teardown"; ?>'); file_put_contents($this->var_dir . '/a/b/.setup.php', '<?php echo "setup2"; ?>'); file_put_contents($this->var_dir . '/a/b/.teardown.php', '<?php echo "teardown2"; ?>'); $test1 = new GeneratedTestClass(); $test2 = new GeneratedTestClass(); file_put_contents($this->var_dir . '/a/b/bar_test.php', $test1->generate()); file_put_contents($this->var_dir . '/a/b/foo_test.php', $test2->generate()); $node = new lmbTestTreeFilePathNode($this->var_dir . '/a', -1); $child = $node->findChildByPath('/0/0/1'); $this->_runNodeAndAssertOutput($child, "setupsetup2" . $test2->getOutput() . "teardown2teardown"); }