| @@ 155-161 (lines=7) @@ | ||
| 152 | $this->assertEquals('a', $cont['foo']); |
|
| 153 | } |
|
| 154 | ||
| 155 | public function testArraySet() |
|
| 156 | { |
|
| 157 | $cont = new Container(['foo' => 'a', 'bar' => 'b']); |
|
| 158 | $cont['baz'] = 'c'; |
|
| 159 | ||
| 160 | $this->assertEquals(['foo' => 'a', 'bar' => 'b', 'baz' => 'c'], $cont->getAll()); |
|
| 161 | } |
|
| 162 | ||
| 163 | public function testArrayHasIsTrue() |
|
| 164 | { |
|
| @@ 177-183 (lines=7) @@ | ||
| 174 | $this->assertFalse(isset($cont['foo'])); |
|
| 175 | } |
|
| 176 | ||
| 177 | public function testArrayRemove() |
|
| 178 | { |
|
| 179 | $cont = new Container(['foo' => 'a', 'bar' => 'b', 'baz' => 'c']); |
|
| 180 | unset($cont['bar']); |
|
| 181 | ||
| 182 | $this->assertEquals(['foo' => 'a', 'baz' => 'c'], $cont->getAll()); |
|
| 183 | } |
|
| 184 | ||
| 185 | public function testArrayRemoveMissing() |
|
| 186 | { |
|
| @@ 155-161 (lines=7) @@ | ||
| 152 | $this->assertEquals(['foo' => 'a', 'bar' => 'b', 'baz' => 'c'], $cont->getAll()); |
|
| 153 | } |
|
| 154 | ||
| 155 | public function testArrayAccessUnset() |
|
| 156 | { |
|
| 157 | $cont = new ImmutableContainer(['foo' => 'a', 'bar' => 'b', 'baz' => 'c']); |
|
| 158 | ||
| 159 | unset($cont['baz']); |
|
| 160 | $this->assertTrue($cont->has('baz')); |
|
| 161 | } |
|
| 162 | ||
| 163 | public function testArrayAccessSet() |
|
| 164 | { |
|
| @@ 163-169 (lines=7) @@ | ||
| 160 | $this->assertTrue($cont->has('baz')); |
|
| 161 | } |
|
| 162 | ||
| 163 | public function testArrayAccessSet() |
|
| 164 | { |
|
| 165 | $cont = new ImmutableContainer(['foo' => 'a', 'bar' => 'b', 'baz' => 'c']); |
|
| 166 | ||
| 167 | $cont['baz'] = 'd'; |
|
| 168 | $this->assertEquals('c', $cont->get('baz')); |
|
| 169 | } |
|
| 170 | } |
|
| 171 | ||
| @@ 155-161 (lines=7) @@ | ||
| 152 | $this->assertEquals(['foo' => 'a', 'bar' => 'b', 'baz' => 'c'], $cont->getAll()); |
|
| 153 | } |
|
| 154 | ||
| 155 | public function testArrayAccessUnset() |
|
| 156 | { |
|
| 157 | $cont = new ImmutableFlatContainer(['foo' => 'a', 'bar' => 'b', 'baz' => 'c']); |
|
| 158 | ||
| 159 | unset($cont['baz']); |
|
| 160 | $this->assertTrue($cont->has('baz')); |
|
| 161 | } |
|
| 162 | ||
| 163 | public function testArrayAccessSet() |
|
| 164 | { |
|
| @@ 163-169 (lines=7) @@ | ||
| 160 | $this->assertTrue($cont->has('baz')); |
|
| 161 | } |
|
| 162 | ||
| 163 | public function testArrayAccessSet() |
|
| 164 | { |
|
| 165 | $cont = new ImmutableFlatContainer(['foo' => 'a', 'bar' => 'b', 'baz' => 'c']); |
|
| 166 | ||
| 167 | $cont['baz'] = 'd'; |
|
| 168 | $this->assertEquals('c', $cont->get('baz')); |
|
| 169 | } |
|
| 170 | } |
|
| 171 | ||