public function testCallingRunThatWillIncludeSteamKey() { $commandParams = ['a' => 'bc']; $url = 'http://base.url.com/built'; $steamKey = 'test_steam_key'; $options = ['query' => array_merge($commandParams, ['key' => $steamKey])]; $commandMock = M::mock('Steam\\Command\\CommandInterface', ['getParams' => $commandParams, 'getRequestMethod' => 'GET']); $this->configMock->shouldReceive('getSteamKey')->andReturn($steamKey); $this->urlBuilderMock->shouldReceive('setBaseUrl')->with('http://base.url.com'); $this->urlBuilderMock->shouldReceive('build')->andReturn($url); $promise = M::mock('GuzzleHttp\\Promise\\PromiseInterface'); $this->clientMock->shouldReceive('sendAsync')->with(M::type('Psr\\Http\\Message\\RequestInterface'), $options)->andReturn($promise)->once(); $this->assertEquals($promise, $this->instance->run($commandMock)); }
/** * {@inheritdoc} * * @return ResponseInterface */ public function run(CommandInterface $command, $result = null) { return parent::run($command, $result)->wait(); }