Changeset 232 in tests for wp-testcase/test_admin_includes_template.php
- Timestamp:
- 07/10/2009 09:22:52 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
wp-testcase/test_admin_includes_template.php
r231 r232 1 1 <?php 2 2 class WPTestCheckedSelected extends WPTestCase { 3 4 function test_numbers() { 3 function test_equal() { 4 $this->assertEquals(' selected=\'selected\'', selected('foo','foo',false)); 5 $this->assertEquals(' checked=\'checked\'', checked('foo','foo',false)); 6 7 $this->assertEquals(' selected=\'selected\'', selected('1',1,false)); 8 $this->assertEquals(' checked=\'checked\'', checked('1',1,false)); 9 10 $this->assertEquals(' selected=\'selected\'', selected('1',true,false)); 11 $this->assertEquals(' checked=\'checked\'', checked('1',true,false)); 12 13 $this->assertEquals(' selected=\'selected\'', selected(1,1,false)); 14 $this->assertEquals(' checked=\'checked\'', checked(1,1,false)); 15 16 $this->assertEquals(' selected=\'selected\'', selected(1,true,false)); 17 $this->assertEquals(' checked=\'checked\'', checked(1,true,false)); 18 19 $this->assertEquals(' selected=\'selected\'', selected(true,true,false)); 20 $this->assertEquals(' checked=\'checked\'', checked(true,true,false)); 21 22 $this->assertEquals(' selected=\'selected\'', selected('0',0,false)); 23 $this->assertEquals(' checked=\'checked\'', checked('0',0,false)); 24 5 25 $this->assertEquals(' selected=\'selected\'', selected(0,0,false)); 6 26 $this->assertEquals(' checked=\'checked\'', checked(0,0,false)); 7 } 8 9 function test_booleans() { 10 $this->assertEquals(' selected=\'selected\'', selected(true,true,false)); 11 $this->assertEquals(' checked=\'checked\'', checked(true,true,false)); 12 } 13 14 function test_strings() { 15 $this->assertEquals(' selected=\'selected\'', selected('one','one',false)); 16 $this->assertEquals(' checked=\'checked\'', checked('one','one',false)); 27 28 $this->assertEquals(' selected=\'selected\'', selected('',false,false)); 29 $this->assertEquals(' checked=\'checked\'', checked('',false,false)); 30 31 $this->assertEquals(' selected=\'selected\'', selected(false,false,false)); 32 $this->assertEquals(' checked=\'checked\'', checked(false,false,false)); 17 33 } 18 34 19 35 function test_notequal() { 36 $this->assertEquals('', selected('0','',false)); 37 $this->assertEquals('', checked('0','',false)); 38 20 39 $this->assertEquals('', selected(0,'',false)); 21 40 $this->assertEquals('', checked(0,'',false)); 41 42 $this->assertEquals('', selected(0,false,false)); 43 $this->assertEquals('', checked(0,false,false)); 22 44 } 23 45 }
Note: See TracChangeset
for help on using the changeset viewer.