Permalink
Browse files

Adding additional test cases for assertTags.

  • Loading branch information...
markstory committed Aug 21, 2011
1 parent daf1251 commit 73f4b8c8bf6280fcb74d230607fb684ff5c00fb2
Showing with 20 additions and 0 deletions.
  1. +20 −0 lib/Cake/Test/Case/TestSuite/CakeTestCaseTest.php
@@ -99,6 +99,26 @@ public function testAssertTagsQuotes() {
'/a'
);
$this->assertTrue($test->assertTags($input, $pattern), 'Single quoted attributes %s');
+
+ $input = "<span><strong>Text</strong></span>";
+ $pattern = array(
+ '<span',
+ '<strong',
+ 'Text',
+ '/strong',
+ '/span'
+ );
+ $this->assertTrue($test->assertTags($input, $pattern), 'Tags with no attributes');
+
+ $input = "<span class='active'><strong>Text</strong></span>";
+ $pattern = array(
+ 'span' => array('class'),
+ '<strong',
+ 'Text',
+ '/strong',
+ '/span'
+ );
+ $this->assertTrue($test->assertTags($input, $pattern), 'Test attribute presence');
}
/**

0 comments on commit 73f4b8c

Please sign in to comment.