Exemple #1
0
 /**
  * testDefaults
  *
  * @dataProvider defaultsProvider
  * @return void
  */
 public function testDefaults($url, $expected)
 {
     $dsn = new DbDsn($url);
     $return = $dsn->toArray();
     $this->assertSame($expected, $return, 'The url should parse as expected');
     $return = $dsn->__toString();
     $this->assertSame($url, $return, 'The dsn should parse back to the same url');
 }
Exemple #2
0
 /**
  * parse a url as a database dsn
  *
  * @param string $url
  * @param array $options
  * @return array
  */
 public static function parse($url, $options = [])
 {
     $inst = new DbDsn($url, $options);
     return $inst->toArray();
 }