webDriverMouse = $this->getMock('Facebook\WebDriver\WebDriverMouse'); $this->locationProvider = $this->getMock('Facebook\WebDriver\Internal\WebDriverLocatable'); $this->webDriverMoveToOffsetAction = new WebDriverMoveToOffsetAction( $this->webDriverMouse, $this->locationProvider, 150, 200 ); } public function testPerformFocusesOnElementAndSendPressKeyCommand() { $coords = $this->getMockBuilder('Facebook\WebDriver\Interactions\Internal\WebDriverCoordinates') ->disableOriginalConstructor()->getMock(); $this->webDriverMouse->expects($this->once())->method('mouseMove')->with($coords, 150, 200); $this->locationProvider->expects($this->once())->method('getCoordinates')->will($this->returnValue($coords)); $this->webDriverMoveToOffsetAction->perform(); } }