A list of arguments to be excluded from the query parameters
Only active if addQueryString is set
public setArgumentsToBeExcludedFromQueryString ( array $argumentsToBeExcludedFromQueryString ) : |
||
$argumentsToBeExcludedFromQueryString | array | |
Результат | the current UriBuilder to allow method chaining |
/** * @test */ public function buildRemovesSpecifiedQueryParametersInCurrentNamespaceIfArgumentsToBeExcludedFromQueryStringIsSetAndRequestIsOfTypeSubRequest() { $this->mockMainRequest->expects($this->once())->method('getArguments')->will($this->returnValue(['Some' => 'Retained Arguments From Request'])); $this->mockSubRequest->expects($this->any())->method('getArgumentNamespace')->will($this->returnValue('SubNamespace')); $this->mockSubRequest->expects($this->any())->method('getArguments')->will($this->returnValue(['Some' => ['Arguments' => 'From Request']])); $this->mockRouter->expects($this->once())->method('resolve')->with(['SubNamespace' => ['Foo' => 'Overruled'], 'Some' => 'Retained Arguments From Request'])->will($this->returnValue('resolvedUri')); $this->uriBuilder->setRequest($this->mockSubRequest); $this->uriBuilder->setAddQueryString(true); $this->uriBuilder->setArguments(['SubNamespace' => ['Foo' => 'Overruled']]); $this->uriBuilder->setArgumentsToBeExcludedFromQueryString(['Some']); $expectedResult = 'resolvedUri'; $actualResult = $this->uriBuilder->build(); $this->assertEquals($expectedResult, $actualResult); }