private function getFinderInterfaceMock($returned) { $mock = $this->getMock('Knp\\Bundle\\KnpBundlesBundle\\Finder\\FinderInterface'); $mock->expects($this->any())->method('find')->will($this->returnValue($returned)); return $mock; }