/**
  * testDefaults
  *
  * @dataProvider defaultsProvider
  * @return void
  */
 public function testDefaults($url, $expected)
 {
     $dsn = new CacheDsn($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');
 }
示例#2
0
 /**
  * parse a url as a cache dsn
  *
  * @param string $url
  * @param array $options
  * @return array
  */
 public static function parse($url, $options = [])
 {
     $inst = new CacheDsn($url, $options);
     return $inst->toArray();
 }