| Conditions | 1 |
| Paths | 1 |
| Total Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | public function test() |
||
| 11 | { |
||
| 12 | $config = $this->app->get(Config::class); |
||
| 13 | $this->assertInstanceOf(Config::class, $config); |
||
| 14 | |||
| 15 | $this->assertSame($config, $this->app->get(Config::class)); |
||
| 16 | |||
| 17 | $this->assertSame($config['service'], 'test'); |
||
| 18 | $this->assertSame($config['environment'], 'testing'); |
||
| 19 | $this->assertSame($config['tarantool.connection'], getenv('TARANTOOL_CONNECTION')); |
||
| 20 | $this->assertCount(4, get_object_vars($config)); |
||
|
|
|||
| 21 | |||
| 22 | $this->assertArrayHasKey('service', $config); |
||
| 23 | |||
| 24 | $config['custom.property'] = true; |
||
| 25 | $this->assertArrayHasKey('custom', $config); |
||
| 26 | $this->assertArrayHasKey('custom.property', $config); |
||
| 27 | |||
| 28 | unset($config['custom']); |
||
| 29 | $this->assertNull($config['custom']); |
||
| 30 | $this->assertNull($config['custom.property']); |
||
| 31 | } |
||
| 32 | } |
||
| 33 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: