Repo2\QueryReactor\Query\GenericQuery::resolve PHP Method

resolve() public method

public resolve ( Repo2\QueryReactor\Result $result )
$result Repo2\QueryReactor\Result
    public function resolve(Result $result)
    {
        if ($this->onFulfill) {
            return call_user_func($this->onFulfill, $result);
        }
    }

Usage Example

Example #1
0
 public function testResolveWithReturn()
 {
     $onFulfill = $this->getMock('\\Repo2\\QueryReactor\\Tests\\Stub');
     $onFulfill->expects($this->once())->method('__invoke')->will($this->returnValue('ILovePHP'));
     $query = new GenericQuery(Fixtures::getSelect(), $onFulfill);
     $this->assertSame('ILovePHP', $query->resolve($this->getResultMock()));
 }