includesTemplate.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * @group admin
  4. */
  5. class Tests_Admin_includesTemplate extends WP_UnitTestCase {
  6. function test_equal() {
  7. $this->assertEquals(' selected=\'selected\'', selected('foo','foo',false));
  8. $this->assertEquals(' checked=\'checked\'', checked('foo','foo',false));
  9. $this->assertEquals(' selected=\'selected\'', selected('1',1,false));
  10. $this->assertEquals(' checked=\'checked\'', checked('1',1,false));
  11. $this->assertEquals(' selected=\'selected\'', selected('1',true,false));
  12. $this->assertEquals(' checked=\'checked\'', checked('1',true,false));
  13. $this->assertEquals(' selected=\'selected\'', selected(1,1,false));
  14. $this->assertEquals(' checked=\'checked\'', checked(1,1,false));
  15. $this->assertEquals(' selected=\'selected\'', selected(1,true,false));
  16. $this->assertEquals(' checked=\'checked\'', checked(1,true,false));
  17. $this->assertEquals(' selected=\'selected\'', selected(true,true,false));
  18. $this->assertEquals(' checked=\'checked\'', checked(true,true,false));
  19. $this->assertEquals(' selected=\'selected\'', selected('0',0,false));
  20. $this->assertEquals(' checked=\'checked\'', checked('0',0,false));
  21. $this->assertEquals(' selected=\'selected\'', selected(0,0,false));
  22. $this->assertEquals(' checked=\'checked\'', checked(0,0,false));
  23. $this->assertEquals(' selected=\'selected\'', selected('',false,false));
  24. $this->assertEquals(' checked=\'checked\'', checked('',false,false));
  25. $this->assertEquals(' selected=\'selected\'', selected(false,false,false));
  26. $this->assertEquals(' checked=\'checked\'', checked(false,false,false));
  27. }
  28. function test_notequal() {
  29. $this->assertEquals('', selected('0','',false));
  30. $this->assertEquals('', checked('0','',false));
  31. $this->assertEquals('', selected(0,'',false));
  32. $this->assertEquals('', checked(0,'',false));
  33. $this->assertEquals('', selected(0,false,false));
  34. $this->assertEquals('', checked(0,false,false));
  35. }
  36. }