/** * @dataProvider urlForNormalizerProvider * * @param \Demo\Domain\ValueObjects\Url $url * @param $expectedResult */ public function testNormalizeCanNormalizeAsExpected(Url $url, $expectedResult) { $this->assertEquals($expectedResult, (string) Normalizer::normalize($url)); }
/** * 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)); }