/** @test */ public function shouldUrlEscapeTreeParam() { $treeArray = array('a', 'b' => array('aa'), 'c'); $treeString = 'a,b[aa],c'; $apiResponse = json_encode(array('a' => 'a value', 'b' => array('aa' => 'aa value'), 'c' => 'c value')); $this->httpMock->expects($this->once())->method('get')->with('http://jenkins.local/job/test/api/json?tree=' . urlencode($treeString))->will($this->returnValue($apiResponse)); $response = $this->fixture->get($treeArray, '/job/test'); }
public function testPassAccessTokenToCaller() { $this->httpMock->expects($this->once())->method('get')->with('http://api.github.test/test?access_token=123abc'); $this->fixture->setAccessToken('123abc'); $response = $this->fixture->get('/test'); }