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');
 }
Exemplo n.º 2
0
 /**
  * @inheritDoc
  */
 public function extractLink($string)
 {
     return parent::extractLink(htmlspecialchars_decode($string));
 }