示例#1
0
 /**
  * @dataProvider getDownloadTest
  */
 public function testDownload($i, $downloadAll)
 {
     $series = new Series();
     $downloadFake = $this->getMock('Series\\Downloader\\DownloadInterface');
     $downloadFake->expects($this->exactly($i))->method('getSupportedType')->will($this->returnValue('FAKE'));
     $downloadFake->expects($this->exactly($i))->method('download');
     $series->setDownloader($downloadFake);
     $statusFake = $this->getMock('Series\\Show\\Status\\StatusInterface');
     $statusFake->expects($this->exactly($i))->method('setMarkAsDownloaded');
     $series->setShowStatus($statusFake);
     $show1 = new MineShow('foo', 1.0);
     $matchedShow1 = new MatchedShow($show1);
     $matchedShow1->addMatchedShow(new UpstreamShow('foo-1', '1.0'));
     $matchedShow1->addMatchedShow(new UpstreamShow('foo-2', '1.0'));
     $matchedShow1->addMatchedShow(new UpstreamShow('foo-3', '1.0'));
     $matchedShow1->addMatchedShow(new UpstreamShow('foo-4', '1.0'));
     $showCollection = new MatchedShowCollection();
     $showCollection->add($matchedShow1);
     $series->download($showCollection, $downloadAll);
 }
示例#2
0
 public function add(MatchedShow $matchedShow)
 {
     $this->collection[$this->getHash($matchedShow->getMineShow())] = $matchedShow;
 }