Permalink
Browse files

Adding some extra test cases for components.

  • Loading branch information...
1 parent 4fb49a1 commit 6abf4dd2b585071edff392b27b61d032b218a25d @zyxist zyxist committed Oct 12, 2010
@@ -51,6 +51,8 @@ public static function dataProvider()
array('Component/component_inject_procedure.txt'),
array('Component/component_inject_snippet.txt'),
array('Component/component_nesting.txt'),
+ array('Component/component_template.txt'),
+ array('Component/component_template_missing.txt'),
);
} // end dataProvider();
@@ -0,0 +1,29 @@
+This test checks, how components work with snippets.
+
+>>>>templates/test.tpl
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<opt:root xmlns:opt="http://xml.invenzzia.org/opt">
+
+<opt:snippet name="foo">
+{$system.component.foo}
+</opt:snippet>
+
+<opt:component from="$component" template="foo">
+<opt:set name="foo" value="str:bar" />
+Joe
+</opt:component>
+
+</opt:root>
+
+>>>>data.php
+
+$view->component = new Extra_Mock_Component;
+
+>>>>expected.txt
+OUTPUT
+
+>>>>result.txt
+VIEW PASSED
+PARAM foo PASSED
+PARAM foo RETURNED
+bar
@@ -0,0 +1,25 @@
+This test checks, how components work with snippets. The missing snippet should
+be ignored.
+
+>>>>templates/test.tpl
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<opt:root xmlns:opt="http://xml.invenzzia.org/opt">
+
+<opt:component from="$component" template="foo">
+<opt:set name="foo" value="str:bar" />
+Joe
+</opt:component>
+
+</opt:root>
+
+>>>>data.php
+
+$view->component = new Extra_Mock_Component;
+
+>>>>expected.txt
+OUTPUT
+
+>>>>result.txt
+VIEW PASSED
+PARAM foo PASSED
+Joe

0 comments on commit 6abf4dd

Please sign in to comment.