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

Commit a69d49f

Browse files
bjohanningjrm2k6
authored andcommitted
Adding PublicIds Parameter for the CloudinaryWrapper->resourcesByIds (#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
1 parent 1386090 commit a69d49f

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/JD/Cloudder/CloudinaryWrapper.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -463,12 +463,13 @@ public function resources($options = array())
463463
/**
464464
* Show Resources by id
465465
*
466-
* @param array $options
466+
* @param array $publicIds
467+
* @param array $options
467468
* @return array
468469
*/
469-
public function resourcesByIds($options = array())
470+
public function resourcesByIds($publicIds, $options = array())
470471
{
471-
return $this->getApi()->resources_by_ids($options);
472+
return $this->getApi()->resources_by_ids($publicIds, $options);
472473
}
473474

474475
/**

tests/CloudinaryWrapperTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,11 +366,13 @@ public function it_should_show_response_when_calling_resources_by_ids()
366366
{
367367
$pids = ['pid1', 'pid2'];
368368

369+
$options = ['test', 'test1'];
370+
369371
// given
370-
$this->api->shouldReceive('resources_by_ids')->once()->with($pids);
372+
$this->api->shouldReceive('resources_by_ids')->once()->with($pids, $options);
371373

372374
// when
373-
$this->cloudinary_wrapper->resourcesByIds($pids);
375+
$this->cloudinary_wrapper->resourcesByIds($pids, $options);
374376
}
375377

376378
/** @test */

0 commit comments

Comments
 (0)