| @@ 35-41 (lines=7) @@ | ||
| 32 | /** |
|
| 33 | * @test |
|
| 34 | */ |
|
| 35 | public function it_recursively_flattens_an_array_to_a_certain_level() |
|
| 36 | { |
|
| 37 | $this->assertEquals( |
|
| 38 | ['a', 'b', ['c'], 'd', 'e'], |
|
| 39 | array_flatten(['a', ['b', ['c'], 'd'], 'e'], 1) |
|
| 40 | ); |
|
| 41 | } |
|
| 42 | ||
| 43 | /** |
|
| 44 | * @test |
|
| @@ 46-52 (lines=7) @@ | ||
| 43 | /** |
|
| 44 | * @test |
|
| 45 | */ |
|
| 46 | public function it_doesnt_flatten_if_the_amount_of_levels_is_0() |
|
| 47 | { |
|
| 48 | $this->assertEquals( |
|
| 49 | ['a', ['b', ['c'], 'd'], 'e'], |
|
| 50 | array_flatten(['a', ['b', ['c'], 'd'], 'e'], 0) |
|
| 51 | ); |
|
| 52 | } |
|
| 53 | } |
|
| 54 | ||