| @@ 54-64 (lines=11) @@ | ||
| 51 | * |
|
| 52 | * @dataProvider hostValues |
|
| 53 | */ |
|
| 54 | public function testHost($dsn, $host) |
|
| 55 | { |
|
| 56 | $dsn = new DSN($dsn); |
|
| 57 | if (is_array($host)) { |
|
| 58 | foreach ($dsn->getHosts() as $index => $h) { |
|
| 59 | $this->assertEquals($host[$index], $h['host']); |
|
| 60 | } |
|
| 61 | } else { |
|
| 62 | $this->assertEquals($host, $dsn->getFirstHost()); |
|
| 63 | } |
|
| 64 | } |
|
| 65 | ||
| 66 | /** |
|
| 67 | * @static |
|
| @@ 100-110 (lines=11) @@ | ||
| 97 | * |
|
| 98 | * @dataProvider portValues |
|
| 99 | */ |
|
| 100 | public function testPort($dsn, $port) |
|
| 101 | { |
|
| 102 | $dsn = new DSN($dsn); |
|
| 103 | if (is_array($port)) { |
|
| 104 | foreach ($dsn->getHosts() as $index => $host) { |
|
| 105 | $this->assertEquals($port[$index], $host['port']); |
|
| 106 | } |
|
| 107 | } else { |
|
| 108 | $this->assertEquals($port, $dsn->getFirstPort()); |
|
| 109 | } |
|
| 110 | } |
|
| 111 | ||
| 112 | /** |
|
| 113 | * @static |
|