public function setUp()
 {
     $this->setCommandName('weburg-series-add');
     parent::setUp();
     $this->configFile = tempnam(sys_get_temp_dir(), 'config');
     $config = new Config($this->configFile);
     $config->saveConfigFile();
     $this->app->setConfig($config);
 }
Example #2
0
 public function testCreateTransmissionClientSuccess()
 {
     $this->setCommandName('weburg-download');
     parent::setUp();
     $this->app->setClient(null);
     $config = new Config();
     $config->set('transmission-host', 'devnull');
     $config->set('transmission-port', 1234);
     $config->set('transmission-user', 'user');
     $config->set('transmission-password', 'pass');
     $config->set('dest', '');
     $this->app->setConfig($config);
     $result = $this->executeCommand();
     $this->assertEquals(1, $result);
     $this->assertRegExp('/Destination directory not defined/', $this->getDisplay());
 }
 public function setUp()
 {
     $this->setCommandName('stats-get');
     parent::setUp();
     $config = new Config();
     $config->set('influxdb-host', 'devnull');
     $config->set('influxdb-port', 1234);
     $config->set('influxdb-user', 'user');
     $config->set('influxdb-password', 'pass');
     $this->app->setConfig($config);
     $this->influxDb = $this->getMockBuilder('InfluxDB\\Client')->setMethods([])->setConstructorArgs([''])->disableOriginalConstructor()->getMock();
     $this->influxDbClient = $this->getMock('Popstas\\Transmission\\Console\\InfluxDbClient', [], [$this->influxDb, 'test']);
     $this->database = $this->getMock('InfluxDB\\Database', [], ['dbname', $this->influxDb]);
     $this->database->method('exists')->will($this->returnValue(true));
     $this->influxDb->method('selectDB')->will($this->returnValue($this->database));
     $this->app->setInfluxDbClient($this->influxDbClient);
 }
 public function setUp()
 {
     $this->setCommandName('weburg-download');
     parent::setUp();
     $this->dest = sys_get_temp_dir() . '/transmission-cli-torrents';
     if (!file_exists($this->dest)) {
         mkdir($this->dest);
     }
     $config = new Config();
     $config->set('download-torrents-dir', $this->dest);
     $config->set('weburg-series-list', [1, 2, 3]);
     $this->app->setConfig($config);
     $httpClient = $this->getMock('GuzzleHttp\\ClientInterface');
     $client = $this->getMock('Popstas\\Transmission\\Console\\WeburgClient', [], [$httpClient]);
     $client->method('getMoviesIds')->will($this->returnValue([1, 2, 3]));
     $client->method('getMovieTorrentUrlsById')->will($this->returnValue(['http://torrent-url']));
     $client->method('getSeriesTorrents')->willReturn(['torrent-url']);
     $client->method('getMovieInfoById')->willReturn(['title' => 'movie', 'comments' => 123, 'rating_imdb' => null]);
     $this->app->setWeburgClient($client);
 }
 public function setUp()
 {
     $this->setCommandName('torrent-list');
     parent::setUp();
 }
 public function setUp()
 {
     $this->setCommandName('torrent-remove-duplicates');
     parent::setUp();
 }
Example #7
0
 public function setUp()
 {
     $this->setCommandName('_docs');
     parent::setUp();
 }