Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding two unit tests to opt:grid.

  • Loading branch information...
commit 7f5445bf0b0a8dcaf96dbf6b680d73a8d1e3006a 1 parent cd6058c
@zyxist zyxist authored
View
2  tests/Package/Instruction/GridTest.php
@@ -47,6 +47,8 @@ public static function dataProvider()
array('Grid/grid_snippets2.txt'),
array('Grid/grid_html.txt'),
array('Grid/grid_one_row.txt'),
+ array('Grid/grid_missing_item.txt'),
+ array('Grid/grid_missing_empty_item.txt'),
);
} // end dataProvider();
View
16 tests/Package/Instruction/Tests/Grid/grid_missing_empty_item.txt
@@ -0,0 +1,16 @@
+Grids with missing opt:empty-item tag should throw an exception.
+
+>>>>templates/test.tpl
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<opt:root xmlns:opt="http://xml.invenzzia.org/opt">
+<opt:grid name="items" cols="3">
+:ROW START
+<opt:item>
+{$items.foo}
+</opt:item>
+:ROW END
+</opt:grid>
+</opt:root>
+
+>>>>expected.txt
+Opt_Instruction_Exception
View
16 tests/Package/Instruction/Tests/Grid/grid_missing_item.txt
@@ -0,0 +1,16 @@
+Grids with missing opt:item tag should throw an exception.
+
+>>>>templates/test.tpl
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<opt:root xmlns:opt="http://xml.invenzzia.org/opt">
+<opt:grid name="items" cols="3">
+:ROW START
+<opt:empty-item>
+Empty
+</opt:empty-item>
+:ROW END
+</opt:grid>
+</opt:root>
+
+>>>>expected.txt
+Opt_Instruction_Exception
Please sign in to comment.
Something went wrong with that request. Please try again.