RubyTest.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. class HTMLPurifier_HTMLModule_RubyTest extends HTMLPurifier_HTMLModuleHarness
  3. {
  4. function setUp() {
  5. parent::setUp();
  6. $this->config->set('HTML.Doctype', 'XHTML 1.1');
  7. }
  8. function testBasicUse() {
  9. $this->assertResult(
  10. '<ruby><rb>WWW</rb><rt>World Wide Web</rt></ruby>'
  11. );
  12. }
  13. function testRPUse() {
  14. $this->assertResult(
  15. '<ruby><rb>WWW</rb><rp>(</rp><rt>World Wide Web</rt><rp>)</rp></ruby>'
  16. );
  17. }
  18. function testComplexUse() {
  19. $this->assertResult(
  20. '<ruby>
  21. <rbc>
  22. <rb>10</rb>
  23. <rb>31</rb>
  24. <rb>2002</rb>
  25. </rbc>
  26. <rtc>
  27. <rt>Month</rt>
  28. <rt>Day</rt>
  29. <rt>Year</rt>
  30. </rtc>
  31. <rtc>
  32. <rt rbspan="3">Expiration Date</rt>
  33. </rtc>
  34. </ruby>'
  35. );
  36. /* not implemented
  37. function testBackwardsCompat() {
  38. $this->assertResult(
  39. '<ruby>A<rp>(</rp><rt>aaa</rt><rp>)</rp></ruby>',
  40. '<ruby><rb>A</rb><rp>(</rp><rt>aaa</rt><rp>)</rp></ruby>'
  41. );
  42. }
  43. */
  44. }
  45. }
  46. // vim: et sw=4 sts=4