Skip to content

Commit

Permalink
Merge pull request #3 from Gadoma/develop
Browse files Browse the repository at this point in the history
fixed LinkShare Id attribution
  • Loading branch information
Gadoma committed Apr 21, 2016
2 parents d8b8451 + cb7e874 commit 5dc7660
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/WalmartApiClient/Http/TransportService.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ protected function composeUrl($uri, array $constraints = [])
$constraints['apiKey'] = $this->apiKey;
$constraints['format'] = 'json';

if (!empty($this->apiLinkShareId) && isset($constraints['includeLinkShare']) && $constraints['includeLinkShare'] === true) {
unset($constraints['includeLinkShare']);
if (!empty($this->apiLinkShareId)) {
$constraints['lsPublisherId'] = $this->apiLinkShareId;
}

Expand Down
4 changes: 1 addition & 3 deletions tests/WalmartApiClient/Http/TransportServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,10 @@ public function testCallApiWithLinkShare()
$apiKey = 'walmartapikey';
$apiLinkShare = 'lsid';

$constraints = ['includeLinkShare' => true];

$client = new \WalmartApiClient\Http\TransportService($guzzle, $handler, $apiKey, $apiLinkShare);

$expected = ['super' => 'cool'];
$actual = $client->callApi('uri', $constraints);
$actual = $client->callApi('uri', []);

$this->assertTrue($actual === $expected);
}
Expand Down

0 comments on commit 5dc7660

Please sign in to comment.