protected function setUp() { parent::setUp(); $this->container = new Container(); $this->pageFactory->shouldReceive('initPage')->andReturn(\Mockery::self()); $this->pageFactory->shouldReceive('initElementContainer')->andReturn(\Mockery::self()); $this->pageFactory->shouldReceive('initElements')->andReturn(\Mockery::self()); $this->selectorsHandler->shouldReceive('isSelectorRegistered')->andReturn(false); $this->selectorsHandler->shouldReceive('registerSelector')->with('se', m::any()); $this->annotationManager = m::mock(self::ANNOTATION_MANAGER_CLASS); $config = new Config(array('base_url' => 'http://domain.tld')); $this->container['config'] = $config; if ($this->getName(false) === 'testGetPage') { $parts = explode('\\', $this->pageClass); array_pop($parts); $config->setOption('page_namespace_prefix', implode('\\', $parts) . '\\'); } $this->realFactory = $this->createFactory(); }
/** * @dataProvider getOptionWithFailureDataProvider */ public function testSetOptionWithFailure(array $options, $name) { $this->setExpectedException('QATools\\QATools\\PageObject\\Exception\\ConfigException', 'Option "' . $name . '" doesn\'t exist in configuration', ConfigException::TYPE_NOT_FOUND); $config = new Config($options); $config->setOption($name, 'x'); }