| Total Complexity | 3 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class SourcesTest extends CommonTestClass |
||
| 11 | { |
||
| 12 | public function testBasic(): void |
||
| 13 | { |
||
| 14 | $source = new Sources\Sources(); |
||
| 15 | $source->setAddress('//abc/def//ghi/jkl'); |
||
| 16 | $this->assertEquals('/abc/def//ghi/jkl', (string) $source); |
||
| 17 | $source->setPath('//abc/def//ghi/jkl'); |
||
| 18 | $this->assertEquals('//abc/def//ghi/jkl', $source->getPath()); |
||
| 19 | } |
||
| 20 | |||
| 21 | public function testAddress() |
||
| 22 | { |
||
| 23 | $source = new Sources\Address('//abc/def//ghi/jkl'); |
||
| 24 | $this->assertEquals('/abc/def//ghi/jkl', (string) $source); |
||
| 25 | } |
||
| 26 | |||
| 27 | public function testArrayAccess() |
||
| 28 | { |
||
| 29 | $array = new \ArrayObject(); |
||
| 30 | $source1 = new Sources\InputArray($array, 'tester'); |
||
| 31 | $this->assertEmpty('', (string) $source1); |
||
| 32 | |||
| 33 | $array->offsetSet('tester', '//abc/def//ghi/jkl'); |
||
| 34 | $source2 = new Sources\InputArray($array, 'tester'); |
||
| 35 | $this->assertEquals('/abc/def//ghi/jkl', (string) $source2); |
||
| 36 | } |
||
| 38 |