public function testParse_filters() { $keyFilter = $this->getMock('r8\\iface\\Filter', array('filter')); $keyFilter->expects($this->once())->method('filter')->with($this->equalTo('key[sub]'))->will($this->returnValue('newKey')); $valFilter = $this->getMock('r8\\iface\\Filter', array('filter')); $valFilter->expects($this->once())->method('filter')->with($this->equalTo('value'))->will($this->returnValue('newVal')); $parser = new \r8\QueryParser(); $parser->setKeyFilter($keyFilter); $parser->setValueFilter($valFilter); $this->assertSame(array("newKey" => "newVal"), $parser->parse("key[sub]=value")); }