public function setUp() { // We need to create RemoteWebDriver instance without calling create(), and to mock its command executor, // so the requests to Selenium don't get actually called $this->driver = $this->getMockBuilder(RemoteWebDriver::class)->disableOriginalConstructor()->setMethods(null)->getMock(); $this->driver->setCommandExecutor(new DummyCommandExecutor()); }