public function testGetUrlBuilderFactory() { /* @var IUrlFactory $url_builder_factory */ $url_builder_factory = m::mock(self::URL_FACTORY_INTERFACE); $this->realFactory->setUrlFactory($url_builder_factory); $this->assertEquals($url_builder_factory, $this->realFactory->getUrlFactory()); }
/** * @dataProvider openedDataProvider */ public function testOpened($url, $matched) { /* @var $page Page */ $page = m::mock($this->pageClass); $this->expectMatchUrlExactAnnotation($page, array(array('url' => 'http://www.domain.tld/relative'), array('url' => 'http://www.domain.tld/relative/path1'), array('url' => 'http://www.domain.tld/relative/path2'))); $this->expectMatchUrlRegexpAnnotation($page, array(array('regexp' => '#/absolute$#'))); $this->expectMatchUrlComponentAnnotation($page, array(array('path' => '/relative/path'))); $this->session->shouldReceive('getCurrentUrl')->once()->andReturn($url); $this->assertSame($matched, $this->realFactory->opened($page)); }
/** * Creates TypifiedPageFactory instance. * * @param Session $session Mink session. * @param Container|Config|null $container_or_config Dependency injection container_or_config or Config. */ public function __construct(Session $session, $container_or_config = null) { $this->annotationRegistry['element-name'] = '\\QATools\\QATools\\HtmlElements\\Annotation\\ElementNameAnnotation'; parent::__construct($session, $container_or_config); }
/** * Creates BEMPageFactory instance. * * @param Session $session Mink session. * @param IConfig $config Page factory configuration. * @param LocatorHelper $locator_helper Locator helper. */ public function __construct(Session $session, IConfig $config = null, LocatorHelper $locator_helper = null) { $this->annotationRegistry['bem'] = '\\QATools\\QATools\\BEM\\Annotation\\BEMAnnotation'; parent::__construct($session, $config); $this->_locatorHelper = isset($locator_helper) ? $locator_helper : new LocatorHelper(); }