コード例 #1
0
 /**
  * @dataProvider urlForNormalizerProvider
  *
  * @param \Demo\Domain\ValueObjects\Url $url
  * @param $expectedResult
  */
 public function testNormalizeCanNormalizeAsExpected(Url $url, $expectedResult)
 {
     $this->assertEquals($expectedResult, (string) Normalizer::normalize($url));
 }
コード例 #2
0
 /**
  * UrlParser constructor.
  *
  * @param string $urlString
  *
  * @throws \InvalidArgumentException If argument is not a string.
  */
 public function __construct($urlString)
 {
     TypeChecker::assertString($urlString, '$urlString');
     $this->url = Normalizer::normalize(new Url($urlString));
 }