|
@@ 56-63 (lines=8) @@
|
| 53 |
|
static::assertEquals(['some', 'text'], iterator_to_array($actual)); |
| 54 |
|
} |
| 55 |
|
|
| 56 |
|
public function testFetchAllWithNoCallable() |
| 57 |
|
{ |
| 58 |
|
$iterator = new ArrayIterator(['some', 'text']); |
| 59 |
|
$reader = $this->buildReader("some text in a stream", $iterator); |
| 60 |
|
|
| 61 |
|
$actual = $reader->fetchAll(); |
| 62 |
|
static::assertEquals(['some', 'text'], $actual); |
| 63 |
|
} |
| 64 |
|
|
| 65 |
|
public function testFetchWithCallable() |
| 66 |
|
{ |
|
@@ 79-88 (lines=10) @@
|
| 76 |
|
static::assertEquals(['some'], $result); |
| 77 |
|
} |
| 78 |
|
|
| 79 |
|
public function testFetchAllWithCallable() |
| 80 |
|
{ |
| 81 |
|
$iterator = new ArrayIterator(['some', 'text']); |
| 82 |
|
$reader = $this->buildReader("some text in a stream", $iterator); |
| 83 |
|
|
| 84 |
|
$actual = $reader->fetchAll(function ($item) { |
| 85 |
|
return $item == 'text'; |
| 86 |
|
}); |
| 87 |
|
static::assertEquals(['text'], array_values($actual)); |
| 88 |
|
} |
| 89 |
|
} |
| 90 |
|
|