| 55 | | |
| 56 | | //More ideas: |
| 57 | | // "text containing <html> symbols & ;" |
| 58 | | // "text containing UTF characters áéÊðöß" |
| 59 | | } |
| | 54 | |
| | 55 | // text containing HTML symbols |
| | 56 | $stuff = parse_tags("<html> & ;"); |
| | 57 | $res_content = "{ ".implode(", ", $stuff)." }"; |
| | 58 | $this->assertContains("<html>", $stuff, "Could not find tag '<html>' in: ".$res_content); |
| | 59 | $this->assertContains("&", $stuff, "Could not find tag '&' in: ".$res_content); |
| | 60 | $this->assertContains(";", $stuff, "Could not find tag ';' in: ".$res_content); |
| | 61 | $this->assertEquals(count($stuff), 3, "parse_tags result contains too many elements: ".$res_content); |
| | 62 | |
| | 63 | // text containing UTF symbols |
| | 64 | $stuff = parse_tags("áé Ãó úÜ Êß ðö"); |
| | 65 | $res_content = "{ ".implode(", ", $stuff)." }"; |
| | 66 | $this->assertContains("áé", $stuff, "Could not find tag 'áé' in: ".$res_content ); |
| | 67 | $this->assertContains("Ãó", $stuff, "Could not find tag 'Ãó' in: ".$res_content); |
| | 68 | $this->assertContains("úÜ", $stuff, "Could not find tag 'úÜ' in: ".$res_content); |
| | 69 | $this->assertContains("Êß", $stuff, "Could not find tag 'Êß' in: ".$res_content); |
| | 70 | $this->assertContains("ðö", $stuff, "Could not find tag 'ðö' in: ".$res_content); |
| | 71 | $this->assertEquals(count($stuff), 5, "parse_tags result contains too many elements: ".$res_content); |
| | 72 | } |
| | 73 | |
| | 74 | function test_urlify_tag() |
| | 75 | { |
| | 76 | $this->assertEquals("%3Chtml%3E",urlify_tag("<html>")); |
| | 77 | $this->assertEquals("this%26that",urlify_tag("this&that")); |
| | 78 | $this->assertEquals("this%20%26%20that",urlify_tag("this & that")); |
| | 79 | $this->assertEquals("here%20%2F%20there",urlify_tag("here / there")); |
| | 80 | } |