| Total Complexity | 2 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | class BasicTest extends CommonTestClass |
||
| 13 | { |
||
| 14 | public function testEmptySources(): void |
||
| 15 | { |
||
| 16 | $handler = new Handler(); |
||
| 17 | $this->assertNull($handler->getSource()); |
||
| 18 | $this->assertNull($handler->getAddress()); |
||
| 19 | $this->assertNotNull($handler->getParams()); |
||
| 20 | |||
| 21 | $handler = new Handler(new Sources\Sources()); |
||
| 22 | $this->assertNotEmpty($handler->getSource()); |
||
| 23 | $this->assertEquals('?', $handler->getAddress()); |
||
| 24 | $this->assertNotEmpty($handler->getParams()); |
||
| 25 | $this->assertEquals([], $handler->getParams()->getParamsData()); |
||
| 26 | } |
||
| 27 | |||
| 28 | public function testBasic(): void |
||
| 29 | { |
||
| 30 | $handler = new Handler(new Sources\Address('//abc/def//?ghi=jkl&mno=pqr&stu=vwx')); |
||
| 31 | $this->assertNotEmpty($handler->getSource()); |
||
| 32 | $this->assertNotEmpty($handler->getParams()); |
||
| 33 | $this->assertNotEmpty($handler->getParams()->getParamsData()); |
||
| 34 | $handler->getParams()->offsetUnset('mno'); |
||
| 35 | $vars = new SingleVariable($handler->getParams()); |
||
| 36 | $vars->setVariableName('poiu')->setVariableValue('ztrewq'); |
||
| 37 | $this->assertEquals('/abc/def//?ghi=jkl&stu=vwx&poiu=ztrewq', $handler->getAddress()); |
||
| 38 | } |
||
| 40 |