| Conditions | 1 |
| Paths | 1 |
| Total Lines | 32 |
| Code Lines | 23 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | public function testIsEditable() { |
||
| 6 | $object = new \CodeReview\Issues\DeprecatedIssue(array( |
||
| 7 | 'name' => 'function_name', |
||
| 8 | 'version' => '1.0', |
||
| 9 | 'file' => 'info.php', |
||
| 10 | 'line' => 321, |
||
| 11 | )); |
||
| 12 | |||
| 13 | $this->assertInstanceOf('ArrayAccess', $object); |
||
| 14 | $this->assertFalse(is_array($object)); |
||
| 15 | |||
| 16 | $this->assertArrayHasKey('name', $object); |
||
| 17 | $this->assertArrayHasKey('version', $object); |
||
| 18 | $this->assertArrayHasKey('file', $object); |
||
| 19 | $this->assertArrayHasKey('line', $object); |
||
| 20 | $this->assertArrayHasKey('reason', $object); |
||
| 21 | |||
| 22 | $this->assertEquals('function_name', $object['name']); |
||
| 23 | $this->assertEquals('1.0', $object['version']); |
||
| 24 | $this->assertEquals('info.php', $object['file']); |
||
| 25 | $this->assertEquals(321, $object['line']); |
||
| 26 | $this->assertEquals('deprecated', $object['reason']); |
||
| 27 | |||
| 28 | $object['version'] = '1.1'; |
||
| 29 | |||
| 30 | $this->assertEquals('1.1', $object['version']); |
||
| 31 | $this->assertTrue(isset($object['version'])); |
||
| 32 | |||
| 33 | unset($object['version']); |
||
| 34 | |||
| 35 | $this->assertFalse(isset($object['version'])); |
||
| 36 | } |
||
| 37 | } |
||
| 38 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.