Skip to content
This repository has been archived by the owner on Feb 4, 2021. It is now read-only.

Commit

Permalink
Adding PublicIds Parameter for the CloudinaryWrapper->resourcesByIds (#…
Browse files Browse the repository at this point in the history
…49)

* Just a small fix to get the package discovery working

* Fix to the resourcesByIds function wrapping the cloudinary resources_by_ids missing parameter

* Changed the parameter to camel case to be consistent with the rest of the project and made the type of array as the sdk expects

* Adjusted the resources_by_ids test to pass with the new parameter structure
  • Loading branch information
bjohanning authored and jrm2k6 committed May 8, 2018
1 parent 1386090 commit a69d49f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/JD/Cloudder/CloudinaryWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,12 +463,13 @@ public function resources($options = array())
/**
* Show Resources by id
*
* @param array $options
* @param array $publicIds
* @param array $options
* @return array
*/
public function resourcesByIds($options = array())
public function resourcesByIds($publicIds, $options = array())
{
return $this->getApi()->resources_by_ids($options);
return $this->getApi()->resources_by_ids($publicIds, $options);
}

/**
Expand Down
6 changes: 4 additions & 2 deletions tests/CloudinaryWrapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,13 @@ public function it_should_show_response_when_calling_resources_by_ids()
{
$pids = ['pid1', 'pid2'];

$options = ['test', 'test1'];

// given
$this->api->shouldReceive('resources_by_ids')->once()->with($pids);
$this->api->shouldReceive('resources_by_ids')->once()->with($pids, $options);

// when
$this->cloudinary_wrapper->resourcesByIds($pids);
$this->cloudinary_wrapper->resourcesByIds($pids, $options);
}

/** @test */
Expand Down

0 comments on commit a69d49f

Please sign in to comment.