webDriverMouse = $this->getMock('Facebook\WebDriver\WebDriverMouse'); $this->locationProvider = $this->getMock('Facebook\WebDriver\Internal\WebDriverLocatable'); $this->webDriverDoubleClickAction = new WebDriverDoubleClickAction( $this->webDriverMouse, $this->locationProvider ); } public function testPerformSendsDoubleClickCommand() { $coords = $this->getMockBuilder('Facebook\WebDriver\Interactions\Internal\WebDriverCoordinates') ->disableOriginalConstructor()->getMock(); $this->webDriverMouse->expects($this->once())->method('doubleClick')->with($coords); $this->locationProvider->expects($this->once())->method('getCoordinates')->will($this->returnValue($coords)); $this->webDriverDoubleClickAction->perform(); } }