public function setUp()
 {
     $this->influxDb = $this->getMockBuilder('InfluxDB\\Client')->setMethods([])->setConstructorArgs([''])->disableOriginalConstructor()->getMock();
     $this->client = new InfluxDbClient($this->influxDb, 'dbname');
     $logger = $this->getMock('\\Psr\\Log\\LoggerInterface');
     $this->client->setLogger($logger);
     parent::setUp();
 }
 public function setUp()
 {
     $this->logger = $this->getMock('\\Psr\\Log\\LoggerInterface');
     $this->httpClient = $this->getMock('GuzzleHttp\\ClientInterface');
     $this->api = $this->getMock('Martial\\Transmission\\API\\RpcClient', [], [$this->httpClient, '', '', $this->logger]);
     $this->csrfException = $this->getMock('Martial\\Transmission\\API\\CSRFException', ['getSessionId']);
     $this->csrfException->method('getSessionId')->will($this->returnValue('123'));
     $this->api->method('sessionGet')->willThrowException($this->csrfException);
     $this->api->method('torrentGet')->will($this->returnValue($this->expectedTorrentList));
     //$this->client = $this->getMock('TransmissionClient', ['getSessionId'], [$this->api]);
     $this->client = new TransmissionClient($this->api);
     parent::setUp();
 }
 public function setUp()
 {
     $this->app = new Application();
     // logger
     $this->logger = $this->getMock('\\Psr\\Log\\LoggerInterface');
     $this->app->setLogger($this->logger);
     // config
     $homeDir = sys_get_temp_dir();
     $this->configFile = tempnam($homeDir, 'transmission-cli.yml');
     if (file_exists($this->configFile)) {
         unlink($this->configFile);
     }
     putenv('HOME=' . $homeDir);
     $config = new Config();
     $config->saveConfigFile();
     // TransmissionClient
     $httpClient = $this->getMock('GuzzleHttp\\ClientInterface');
     $api = $this->getMock('Martial\\Transmission\\API\\RpcClient', [], [$httpClient, '', '']);
     $client = $this->getMock('Popstas\\Transmission\\Console\\TransmissionClient', [], [$api]);
     $client->method('getTorrentData')->will($this->returnValue($this->expectedTorrentList));
     $this->app->setClient($client);
     // InfluxDbClient
     $influxDb = $this->getMockBuilder('InfluxDB\\Client')->setMethods([])->setConstructorArgs([''])->disableOriginalConstructor()->getMock();
     $influxDbClient = new InfluxDbClient($influxDb, 'dbname');
     $database = $this->getMock('InfluxDB\\Database', [], ['dbname', $influxDb]);
     $queryBuilder = $this->getMock('InfluxDB\\Query\\Builder', ['getResultSet'], [$database]);
     $resultSet = $this->getMockBuilder('InfluxDB\\ResultSet')->setMethods([])->setConstructorArgs([''])->disableOriginalConstructor()->getMock();
     $resultSet->method('getPoints')->willReturn([]);
     $queryBuilder->method('getResultSet')->will($this->returnValue($resultSet));
     $database->method('getQueryBuilder')->willReturn($queryBuilder);
     $influxDbClient->setDatabase($database);
     $this->app->setInfluxDbClient($influxDbClient);
     $this->command = $this->app->find($this->commandName);
     $this->commandTester = new CommandTester($this->command);
     parent::setUp();
 }
 public function setUp()
 {
     $this->httpClient = $this->getMock('GuzzleHttp\\ClientInterface');
     $this->client = new WeburgClient($this->httpClient);
     parent::setUp();
 }