|
@@ 15-24 (lines=10) @@
|
| 12 |
|
$this->array = array("a", "bunch", "of", "words", "in", "an", "array");; |
| 13 |
|
} |
| 14 |
|
|
| 15 |
|
public function testRemoveFromArrayByIndex() |
| 16 |
|
{ |
| 17 |
|
ArrayUtils::removeByIndex($this->array, 0); |
| 18 |
|
$this->assertEquals(6, count($this->array)); |
| 19 |
|
$this->assertEquals(array("bunch", "of", "words", "in", "an", "array"), $this->array); |
| 20 |
|
|
| 21 |
|
ArrayUtils::removeByIndex($this->array, 2); |
| 22 |
|
$this->assertEquals(5, count($this->array)); |
| 23 |
|
$this->assertEquals(array("bunch", "of", "in", "an", "array"), $this->array); |
| 24 |
|
} |
| 25 |
|
|
| 26 |
|
public function testGetElementOnRemoveByIndex() |
| 27 |
|
{ |
|
@@ 33-42 (lines=10) @@
|
| 30 |
|
$this->assertEquals("of", ArrayUtils::removeByIndex($this->array, 0)); |
| 31 |
|
} |
| 32 |
|
|
| 33 |
|
public function testRemoveFromArray() |
| 34 |
|
{ |
| 35 |
|
ArrayUtils::remove($this->array, "a"); |
| 36 |
|
$this->assertEquals(6, count($this->array)); |
| 37 |
|
$this->assertEquals(array("bunch", "of", "words", "in", "an", "array"), $this->array); |
| 38 |
|
|
| 39 |
|
ArrayUtils::remove($this->array, "words"); |
| 40 |
|
$this->assertEquals(5, count($this->array)); |
| 41 |
|
$this->assertEquals(array("bunch", "of", "in", "an", "array"), $this->array); |
| 42 |
|
} |
| 43 |
|
|
| 44 |
|
} |
| 45 |
|
|