Changeset 1721
- Timestamp:
- 07/20/08 17:47:25 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
framework/trunk/src/main/php/net/stubbles/lang/stubArrayAccessor.php
r1719 r1721 182 182 return new ArrayIterator($this->data); 183 183 } 184 185 /** 186 * returns a list of all keys of the wrapped array 187 * 188 * @return array<int,scalar> 189 */ 190 public function getKeys() 191 { 192 return array_keys($this->data); 193 } 184 194 } 185 195 ?> framework/trunk/src/test/php/net/stubbles/lang/stubArrayAccessorTestCase.php
r1701 r1721 201 201 ); 202 202 } 203 204 /** 205 * keys of wrapped array should be returned 206 * 207 * @test 208 */ 209 public function getKeys() 210 { 211 $this->assertEquals(array('first', 'second', 'third'), 212 $this->arrayAccessorAssociative->getKeys() 213 ); 214 $this->assertEquals(array(0, 1, 2), 215 $this->arrayAccessorNumeric->getKeys() 216 ); 217 $this->assertEquals(array(0), 218 $this->arrayAccessorOne->getKeys() 219 ); 220 $this->assertEquals(array(), 221 $this->arrayAccessorEmpty->getKeys() 222 ); 223 } 203 224 } 204 225 ?>
