/** * @param string $value * @return VideoInputInterface|null */ public function getByValue($value) { $videoInputUrl = new VideoInputUrl($value); if ($videoInputUrl->isValid()) { return $videoInputUrl; } unset($videoInputUrl); $videoInputId = new VideoInputId($value); if ($videoInputId->isValid()) { return $videoInputId; } unset($videoInputId); return null; }
public function testInvalidYouTubeId() { $videoInputUrl = new VideoInputUrl('invalid url'); $this->setExpectedException('YouTubeiest\\Exception'); $videoInputUrl->getYouTubeId(); }