public function testTryingToTransformLinkWithInvalidPatternWillThrowRegexException() { $configurationName = md5(rand()); //Some random name, can be anything $this->aggregatorConfiguration->expects($this->any())->method('getName')->willReturn($configurationName); $this->aggregatorConfiguration->expects($this->any())->method('getLinkExtractPattern')->willReturn('/(.+)/'); $this->aggregatorConfiguration->expects($this->atLeastOnce())->method('getLinkTransformPattern')->willReturn('^wtf /r'); $this->setExpectedException('\\noFlash\\TorrentGhost\\Exception\\RegexException', 'Pattern was configured for ' . $configurationName . ' aggregator to transform link'); $this->subjectUnderTest->extractLink('this is example string'); }
/** * @inheritDoc */ public function extractLink($string) { return parent::extractLink(htmlspecialchars_decode($string)); }