public function testCreateDriver() { /** @var m\MockInterface $driver_factory */ $driver_factory = $this->driverFactoryRegistry->get('selenium2'); $driver_factory->shouldReceive('createDriver')->with($this->browser)->once()->andReturn('OK'); $this->assertEquals('OK', $this->browser->createDriver()); }
/** * Creates driver based on browser configuration. * * @return DriverInterface */ public function createDriver() { $factory = $this->_driverFactoryRegistry->get($this->getDriver()); return $factory->createDriver($this); }
/** * @expectedException \OutOfBoundsException * @expectedExceptionMessage No driver factory for "test" driver. */ public function testGettingNonExisting() { $this->_driverFactoryRegistry->get('test'); }