getMockBuilder('Alchemy\Zippy\Resource\ResourceManager') ->disableOriginalConstructor() ->getMock(); $manager->expects($this->any()) ->method('handle') ->will($this->returnValue($collection)); return $manager; } protected function getResource($data = null) { $resource = $this->getMock('Alchemy\Zippy\Adapter\Resource\ResourceInterface'); if (null !== $data) { $resource->expects($this->any()) ->method('getResource') ->will($this->returnValue($data)); } return $resource; } }