/** * Returns selector, that combines block, element and modificator. * * @param LocatorHelper $locator_helper Locator helper. * * @return array */ public function getSelector(LocatorHelper $locator_helper) { list($modificator_name, $modificator_value) = $this->getModificator(); if ($this->element) { return $locator_helper->getElementLocator($this->element, $this->block, $modificator_name, $modificator_value); } return $locator_helper->getBlockLocator($this->block, $modificator_name, $modificator_value); }
/** * Returns block locator. * * @param string $block_name Block name. * @param string|null $modificator_name Modificator name. * @param string|null $modificator_value Modificator value. * * @return array */ public function getBlockLocator($block_name, $modificator_name = null, $modificator_value = null) { return $this->_helper->getBlockLocator($block_name, $modificator_name, $modificator_value); }
public function testGetBlockLocatorWithModificator() { $locator = $this->_locatorHelper->getBlockLocator('block-name', 'modificator-name', 'modificator-value'); $this->_assertLocatorClassName($locator, 'block-name_modificator-name_modificator-value'); }