test/unit/Container/ImmutableContainerTest.php 1 location
|
@@ 46-57 (lines=12) @@
|
| 43 |
|
$cont->add('baz', 'd'); |
| 44 |
|
} |
| 45 |
|
|
| 46 |
|
public function testForAll() |
| 47 |
|
{ |
| 48 |
|
$params = ['foo' => 'a', 'bar' => 'b', 'baz' => 'c']; |
| 49 |
|
$seen = []; |
| 50 |
|
|
| 51 |
|
$cont = new ImmutableContainer($params); |
| 52 |
|
$cont->forAll(function ($value, $key) use (&$seen) { |
| 53 |
|
$seen[$key] = $value; |
| 54 |
|
}); |
| 55 |
|
|
| 56 |
|
$this->assertEquals($params, $seen); |
| 57 |
|
} |
| 58 |
|
|
| 59 |
|
public function testGet() |
| 60 |
|
{ |
test/unit/Container/ContainerTest.php 1 location
|
@@ 48-59 (lines=12) @@
|
| 45 |
|
$cont->add('baz', 'd'); |
| 46 |
|
} |
| 47 |
|
|
| 48 |
|
public function testForAll() |
| 49 |
|
{ |
| 50 |
|
$params = ['foo' => 'a', 'bar' => 'b', 'baz' => 'c']; |
| 51 |
|
$seen = []; |
| 52 |
|
|
| 53 |
|
$cont = new Container($params); |
| 54 |
|
$cont->forAll(function ($value, $key) use (&$seen) { |
| 55 |
|
$seen[$key] = $value; |
| 56 |
|
}); |
| 57 |
|
|
| 58 |
|
$this->assertEquals($params, $seen); |
| 59 |
|
} |
| 60 |
|
|
| 61 |
|
public function testGet() |
| 62 |
|
{ |