Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- The `Api::getRoles` call was always retuning an error by [@aik099].
- Attempt to make a `DELETE` API call using `CurlClient` wasn't working by [@aik099].
- Clearing local caches (statuses, priorities, fields and resolutions) on endpoint change by [@jpastoor].
- Error details from failed API calls were not available back from Api::api method call by [@betterphp].

## [1.0.0] - 2014-07-27
### Added
Expand All @@ -59,3 +60,4 @@ This project adheres to [Semantic Versioning](http://semver.org/).
[@digitalkaoz]: https://github.com/digitalkaoz
[@DerMika]: https://github.com/DerMika
[@aik099]: https://github.com/aik099
[@betterphp]: https://github.com/betterphp
1 change: 1 addition & 0 deletions src/Jira/Api/Client/PHPClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ public function sendRequest(
'http' => array(
'method' => $method,
'header' => implode("\r\n", $header),
'ignore_errors' => true,
),
);

Expand Down
15 changes: 13 additions & 2 deletions tests/Jira/Api/Client/AbstractClientTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,27 @@ protected function setUp()
$this->client = $this->createClient();
}

public function testGetRequest()
/**
* @dataProvider getRequestWithKnownHttpCodeDataProvider
*/
public function testGetRequestWithKnownHttpCode($http_code)
{
$data = array('param1' => 'value1', 'param2' => 'value2');
$trace_result = $this->traceRequest(Api::REQUEST_GET, $data);
$trace_result = $this->traceRequest(Api::REQUEST_GET, array_merge(array('http_code' => $http_code), $data));

$this->assertEquals('GET', $trace_result['_SERVER']['REQUEST_METHOD']);
$this->assertContentType('application/json;charset=UTF-8', $trace_result);
$this->assertEquals($data, $trace_result['_GET']);
}

public function getRequestWithKnownHttpCodeDataProvider()
{
return array(
'http 200' => array(200),
'http 403' => array(403),
);
}

/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage Data must be an array.
Expand Down