Changeset 35025 for trunk/tests/phpunit/tests/option/networkOption.php
- Timestamp:
- 10/11/2015 11:29:55 PM (10 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/option/networkOption.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/option/networkOption.php
r35024 r35025 39 39 $this->assertEquals( $value, get_network_option( $id, $option, false ) ); 40 40 } 41 42 /** 43 * @dataProvider data_network_id_parameter 44 * 45 * @param $network_id 46 * @param $expected_response 47 */ 48 function test_add_network_option_network_id_parameter( $network_id, $expected_response ) { 49 $option = rand_str(); 50 $value = rand_str(); 51 52 $this->assertEquals( $expected_response, add_network_option( $network_id, $option, $value ) ); 53 } 54 55 /** 56 * @dataProvider data_network_id_parameter 57 * 58 * @param $network_id 59 * @param $expected_response 60 */ 61 function test_get_network_option_network_id_parameter( $network_id, $expected_response ) { 62 $option = rand_str(); 63 64 $this->assertEquals( $expected_response, get_network_option( $network_id, $option, true ) ); 65 } 66 67 function data_network_id_parameter() { 68 return array( 69 // Numeric values should always be accepted. 70 array( 1, true ), 71 array( '1', true ), 72 array( 2, true ), 73 74 // Null, false, and zero will be treated as the current network. 75 array( null, true ), 76 array( false, true ), 77 array( 0, true ), 78 array( '0', true ), 79 80 // Other truthy or string values should be rejected. 81 array( true, false ), 82 array( 'string', false ), 83 ); 84 } 41 85 } 42 86
Note: See TracChangeset
for help on using the changeset viewer.