| Conditions | 1 |
| Paths | 1 |
| Total Lines | 27 |
| Code Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 17 | public function testConstruct() |
||
| 18 | { |
||
| 19 | $connectionConfigUrl = new ConnectionConfigUrl( |
||
| 20 | \sprintf( |
||
| 21 | '%s://%s:%s@%s:%d/%s', |
||
| 22 | static::URL_PART_SCHEME, |
||
| 23 | static::URL_PART_USER, |
||
| 24 | static::URL_PART_PASS, |
||
| 25 | static::URL_PART_HOST, |
||
| 26 | static::URL_PART_PORT, |
||
| 27 | static::URL_PART_PATH |
||
| 28 | ) |
||
| 29 | ); |
||
| 30 | |||
| 31 | $this->assertEquals( |
||
| 32 | \sprintf( |
||
| 33 | '%s:host=%s;dbname=%s;charset=utf8mb4;port=%d', |
||
| 34 | static::URL_PART_SCHEME, |
||
| 35 | static::URL_PART_HOST, |
||
| 36 | static::URL_PART_PATH, |
||
| 37 | static::URL_PART_PORT |
||
| 38 | ), |
||
| 39 | $connectionConfigUrl->generateDsn() |
||
| 40 | ); |
||
| 41 | $this->assertEquals(static::URL_PART_USER, $connectionConfigUrl->getUsername()); |
||
| 42 | $this->assertEquals(static::URL_PART_PASS, $connectionConfigUrl->getPassword()); |
||
| 43 | $this->assertEquals(static::URL_PART_PATH, $connectionConfigUrl->getDbname()); |
||
| 44 | } |
||
| 46 |