예제 #1
0
 /**
  * testDefaults
  *
  * @dataProvider defaultsProvider
  * @return void
  */
 public function testDefaults($url, $expected)
 {
     $dsn = new EmailDsn($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 an email dsn
  *
  * @param string $url
  * @param array $options
  * @return array
  */
 public static function parse($url, $options = [])
 {
     $inst = new EmailDsn($url, $options);
     return $inst->toArray();
 }