コード例 #1
0
ファイル: BEMAnnotation.php プロジェクト: qa-tools/qa-tools
 /**
  * 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);
 }
コード例 #2
0
 /**
  * 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);
 }
コード例 #3
0
 public function testGetBlockLocatorWithModificator()
 {
     $locator = $this->_locatorHelper->getBlockLocator('block-name', 'modificator-name', 'modificator-value');
     $this->_assertLocatorClassName($locator, 'block-name_modificator-name_modificator-value');
 }