protected function setUp()
 {
     parent::setUp();
     $this->annotationManager = m::mock(self::ANNOTATION_MANAGER_CLASS);
     $this->pageUrlMatcherRegistry = new PageUrlMatcherRegistry($this->annotationManager);
     $this->page = m::mock('\\QATools\\QATools\\PageObject\\Page');
 }
Example #2
0
 protected function setUp()
 {
     parent::setUp();
     $this->pageFactory->shouldReceive('initPage')->once()->andReturn($this->pageFactory);
     $this->pageFactory->shouldReceive('initElements')->once()->andReturn($this->pageFactory);
     $decorator = m::mock('\\QATools\\QATools\\PageObject\\PropertyDecorator\\IPropertyDecorator');
     $this->pageFactory->shouldReceive('createDecorator')->once()->andReturn($decorator);
     $this->urlBuilderFactory = m::mock('\\QATools\\QATools\\PageObject\\Url\\IUrlFactory');
     $this->page = new $this->pageClass($this->pageFactory);
 }
 protected function setUp()
 {
     parent::setUp();
     if (is_null($this->elementClass)) {
         $this->elementClass = '\\tests\\QATools\\QATools\\HtmlElements\\Fixture\\Element\\TypifiedElementChild';
     }
     $this->webElement = m::mock(self::WEB_ELEMENT_CLASS);
     $this->webElement->shouldReceive('getSession')->withNoArgs()->andReturn($this->session);
     $this->setUpBeforeCreateElement();
     $this->typifiedElement = $this->createElement();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->property = m::mock('\\QATools\\QATools\\PageObject\\Property');
     $this->locator = m::mock($this->locatorClass);
     $this->locatorFactory = m::mock('\\QATools\\QATools\\PageObject\\ElementLocator\\IElementLocatorFactory');
     if ($this->getName() == 'testEmptyLocatorPreventsDecoration') {
         $this->locatorFactory->shouldReceive('createLocator');
     } else {
         $this->locatorFactory->shouldReceive('createLocator')->andReturn($this->locator);
     }
     $this->decorator = new $this->decoratorClass($this->locatorFactory, $this->pageFactory);
 }
 protected function setUp()
 {
     parent::setUp();
     $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);
     $this->urlFactory = m::mock(self::URL_FACTORY_INTERFACE);
     $this->config = new Config(array('base_url' => 'http://domain.tld'));
     $this->realFactory = $this->createFactory();
 }
Example #6
0
 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();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->escaper = m::mock('Behat\\Mink\\Selector\\Xpath\\Escaper');
     if (is_null($this->elementClass)) {
         $this->elementClass = '\\tests\\QATools\\QATools\\HtmlElements\\Fixture\\Element\\TypifiedElementChild';
     }
     $this->webElement = m::mock(self::WEB_ELEMENT_CLASS);
     $this->webElement->shouldReceive('getSession')->withNoArgs()->andReturn($this->session);
     $this->webElement->shouldReceive('getXpathEscaper')->withNoArgs()->andReturn($this->escaper);
     if (!in_array($this->getName(false), $this->ignoreExpectTypifiedNodeCheck)) {
         $this->expectWebElementGetTagName($this->expectedTagName);
         $this->expectDriverGetTagName($this->expectedTagName);
         $this->expectWebElementGetAttribute($this->expectedAttributes);
         $this->expectDriverGetAttribute($this->expectedAttributes);
         $this->setUpBeforeCreateElement();
         $this->typifiedElement = $this->createElement();
     } else {
         $this->setUpBeforeCreateElement();
     }
 }
 protected function setUp()
 {
     $this->pageUrlMatcher = new $this->className();
     parent::setUp();
 }
 /**
  * Creates NodeElement mock.
  *
  * @param string|null $xpath XPath of the element.
  *
  * @return NodeElement
  */
 protected function createNodeElement($xpath = null)
 {
     $element = parent::createNodeElement($xpath);
     if ($this->getName(false) === 'testProxyWebElement') {
         $this->selectorsHandler->shouldReceive('selectorToXpath')->with('se', array('xpath' => $xpath))->andReturn($xpath);
     }
     return $element;
 }
 protected function setUp()
 {
     parent::setUp();
     $this->beforeSetUpFinish();
     $this->element = $this->createElement();
 }