Changeset 50965 for trunk/tests/phpunit/tests/functions/wpArrayGet.php
- Timestamp:
- 05/24/2021 12:24:14 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/functions/wpArrayGet.php
r50964 r50965 58 58 59 59 /** 60 * Test _wp_array_get() with non 60 * Test _wp_array_get() with non-subtree paths. 61 61 * 62 62 * @ticket 51720 63 63 */ 64 64 public function test_wp_array_get_simple_non_subtree() { 65 // Simple non subtree test.65 // Simple non-subtree test. 66 66 $this->assertSame( 67 67 _wp_array_get( … … 74 74 ); 75 75 76 // Simple non subtree not found.76 // Simple non-subtree not found. 77 77 $this->assertSame( 78 78 _wp_array_get( … … 85 85 ); 86 86 87 // Simple non subtree not found with a default.87 // Simple non-subtree not found with a default. 88 88 $this->assertSame( 89 89 _wp_array_get( … … 97 97 ); 98 98 99 // Simple non subtree integer path.99 // Simple non-subtree integer path. 100 100 $this->assertSame( 101 101 _wp_array_get( … … 112 112 113 113 /** 114 * Test _wp_array_get() with subtrees. 115 * 116 * @ticket 51720 117 */ 118 public function test_wp_array_get_subtree() { 119 $this->assertSame( 120 _wp_array_get( 121 array( 122 'a' => array( 123 'b' => array( 124 'c' => 1, 125 ), 126 ), 127 ), 128 array( 'a', 'b' ) 129 ), 130 array( 'c' => 1 ) 131 ); 132 133 $this->assertSame( 134 _wp_array_get( 135 array( 136 'a' => array( 137 'b' => array( 138 'c' => 1, 139 ), 140 ), 141 ), 142 array( 'a', 'b', 'c' ) 143 ), 144 1 145 ); 146 147 $this->assertSame( 148 _wp_array_get( 149 array( 150 'a' => array( 151 'b' => array( 152 'c' => 1, 153 ), 154 ), 155 ), 156 array( 'a', 'b', 'c', 'd' ) 157 ), 158 null 159 ); 160 } 161 162 /** 114 163 * Test _wp_array_get() with zero strings. 115 164 * … … 159 208 ), 160 209 'b' 161 );162 }163 164 165 /**166 * Test _wp_array_get() with subtrees.167 *168 * @ticket 51720169 */170 public function test_wp_array_get_subtree() {171 $this->assertSame(172 _wp_array_get(173 array(174 'a' => array(175 'b' => array(176 'c' => 1,177 ),178 ),179 ),180 array( 'a', 'b' )181 ),182 array( 'c' => 1 )183 );184 185 $this->assertSame(186 _wp_array_get(187 array(188 'a' => array(189 'b' => array(190 'c' => 1,191 ),192 ),193 ),194 array( 'a', 'b', 'c' )195 ),196 1197 );198 199 $this->assertSame(200 _wp_array_get(201 array(202 'a' => array(203 'b' => array(204 'c' => 1,205 ),206 ),207 ),208 array( 'a', 'b', 'c', 'd' )209 ),210 null211 210 ); 212 211 }
Note: See TracChangeset
for help on using the changeset viewer.