public function testCustomParameter() { $parameterMock = $this->getMock('Pinq\\Providers\\DSL\\Compilation\\Parameters\\IQueryParameter'); $parameterMock->expects($this->any())->method('evaluate')->with($this->equalTo(new ResolvedParameterRegistry(['abc' => 'foobar'])))->willReturn('resolved-value'); $this->collection->add($parameterMock); $this->assertResolvesTo(['resolved-value'], ['abc' => 'foobar']); }
protected function addParameter(Parameters\ParameterCollection $parameters, IFunction $function, O\Expression $expression, Parameters\IParameterHasher $hasher = null) { $parameters->add(new StructuralExpressionParameter($expression, $hasher ?: Parameters\ParameterHasher::valueType(), $function)); }