/** * @param $url * @return YoutubeServiceAdapter * @throws ServiceNotAvailableException */ public function getMockingObject($url) { $videoParser = new VideoServiceMatcher(); $youtubeVideo = $videoParser->parse($url); return $youtubeVideo; }
/** * @dataProvider videoUrlProvider * @param $url * @throws ServiceNotAvailableException */ public function testServiceDetectorDontReparseSameUrl($url) { $detector = new VideoServiceMatcher(); $video = $detector->parse($url); $this->assertSame($video, $detector->parse($url)); }