public function testRenderLibraries() { $map = $this->getMock('Ivory\\GoogleMap\\Map'); $markerCluster = $this->getMock('Ivory\\GoogleMap\\Overlays\\MarkerCluster'); $markerCluster->expects($this->any())->method('getType')->will($this->returnValue('foo')); $helperMock = $this->getMock('Ivory\\GoogleMap\\Helper\\Overlays\\MarkerCluster\\MarkerClusterHelperInterface'); $helperMock->expects($this->once())->method('renderLibraries')->with($this->equalTo($markerCluster), $this->equalTo($map))->will($this->returnValue('bar')); $this->helper->setHelper('foo', $helperMock); $this->assertSame('bar', $this->helper->renderLibraries($markerCluster, $map)); }