Beispiel #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);
 }
Beispiel #2
0
        if (is_array($app['series.downloader'])) {
            foreach ($app['series.downloader'] as $downloader) {
                $series->getDownloader()->addDownloader($downloader);
            }
        } else {
            $series->setDownloader($app['series.downloader']);
        }
    }
    /** Show Status */
    if (isset($app['series.show.status'])) {
        if (is_array($app['series.show.status'])) {
            foreach ($app['series.show.status'] as $status) {
                $series->getShowStatus()->addStatus($status);
            }
        } else {
            $series->setShowStatus($app['series.show.status']);
        }
        // Share the same show status between the Matcher (will call isAlreadyDownloaded)
        // And the Serie Object (will call setMarkAsDownloaded)
        $series->getMatcher()->setShowStatus($series->getShowStatus());
    }
    return $series;
};
// Declaration of core/default services
$app['series.extension.provider.mine.yaml.path'] = __DIR__ . '/config/show.yml';
$app['series.extension.provider.mine.yaml'] = function ($app) {
    return new Yaml($app['series.extension.provider.mine.yaml.path']);
};
$app['series.extension.provider.upsteam.daily_tv_torrent'] = function () {
    return new DailyTvTorrentProvider(new Buzz\Browser());
};