| @@ 44-55 (lines=12) @@ | ||
| 41 | $cont->add('baz', 'd'); |
|
| 42 | } |
|
| 43 | ||
| 44 | public function testForAll() |
|
| 45 | { |
|
| 46 | $params = ['foo' => 'a', 'bar' => 'b', 'baz' => 'c']; |
|
| 47 | $seen = []; |
|
| 48 | ||
| 49 | $cont = new Container($params); |
|
| 50 | $cont->forAll(function ($value, $key) use (&$seen) { |
|
| 51 | $seen[$key] = $value; |
|
| 52 | }); |
|
| 53 | ||
| 54 | $this->assertEquals($params, $seen); |
|
| 55 | } |
|
| 56 | ||
| 57 | public function testGet() |
|
| 58 | { |
|
| @@ 45-56 (lines=12) @@ | ||
| 42 | $result = $cont->add('baz', 'd'); |
|
| 43 | } |
|
| 44 | ||
| 45 | public function testForAll() |
|
| 46 | { |
|
| 47 | $params = ['foo' => 'a', 'bar' => 'b', 'baz' => 'c']; |
|
| 48 | $seen = []; |
|
| 49 | ||
| 50 | $cont = new ImmutableContainer($params); |
|
| 51 | $cont->forAll(function ($value, $key) use (&$seen) { |
|
| 52 | $seen[$key] = $value; |
|
| 53 | }); |
|
| 54 | ||
| 55 | $this->assertEquals($params, $seen); |
|
| 56 | } |
|
| 57 | ||
| 58 | public function testGet() |
|
| 59 | { |
|