Skip to content

Commit 9ecd491

Browse files
committed
Organization: use POST for sync
1 parent 0561503 commit 9ecd491

File tree

3 files changed

+2
-22
lines changed

3 files changed

+2
-22
lines changed

Diff for: src/Api/AbstractApi.php

-20
Original file line numberDiff line numberDiff line change
@@ -60,26 +60,6 @@ protected function post($path, array $parameters = [], array $headers = [])
6060
return $this->responseMediator->getContent($response);
6161
}
6262

63-
/**
64-
* @param string $path
65-
* @param array $parameters
66-
* @param array $headers
67-
* @return array|string
68-
*/
69-
protected function put($path, array $parameters = [], array $headers = [])
70-
{
71-
$response = $this->client->getHttpClient()->put(
72-
$path,
73-
array_merge($headers, [
74-
'Accept' => 'application/json',
75-
'Content-Type' => 'application/json',
76-
]),
77-
$this->createJsonBody($parameters)
78-
);
79-
80-
return $this->responseMediator->getContent($response);
81-
}
82-
8363
/**
8464
* @param string $path
8565
* @param array $parameters

Diff for: src/Api/Organization.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ class Organization extends AbstractApi
66
{
77
public function sync()
88
{
9-
return $this->put('/organization/sync');
9+
return $this->post('/organization/sync');
1010
}
1111
}

Diff for: tests/Api/OrganizationTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public function testSync()
1111
/** @var Organization&\PHPUnit_Framework_MockObject_MockObject $api */
1212
$api = $this->getApiMock();
1313
$api->expects($this->once())
14-
->method('put')
14+
->method('post')
1515
->with($this->equalTo('/organization/sync'))
1616
->will($this->returnValue($expected));
1717

0 commit comments

Comments
 (0)