Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge release 1.6.2 into 1.7.x #29

Merged
merged 5 commits into from
Apr 19, 2022
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
3 changes: 2 additions & 1 deletion src/AbstractResourceListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Laminas\EventManager\ListenerAggregateInterface;
use Laminas\EventManager\ListenerAggregateTrait;
use Laminas\InputFilter\InputFilterInterface;
use Laminas\Stdlib\Parameters;

use function sprintf;

Expand Down Expand Up @@ -252,7 +253,7 @@ public function fetch($id)
/**
* Fetch all or a subset of resources
*
* @param array $params
* @param array|Parameters $params
* @return ApiProblem|mixed
*/
public function fetchAll($params = [])
Expand Down
13 changes: 13 additions & 0 deletions test/AbstractResourceListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,17 @@ public function testDispatchShouldPassWhitelistedQueryParamsToFetchAllMethod()

$this->assertEquals($queryParams, $this->listener->testCase->paramsPassedToListener);
}

/**
* @group 7
*/
public function testDispatchShouldPassEmptyArrayToFetchAllMethodIfNoQueryParamsArePresent()
{
$event = new ResourceEvent();
$event->setName('fetchAll');

$this->listener->dispatch($event);

$this->assertEquals([], $this->listener->testCase->paramsPassedToListener);
}
}