コード例 #1
0
 public function testGetBlockSelectorWithModificator()
 {
     $this->_annotation->block = 'block-name';
     $this->_annotation->modificator = array('modificator-name' => 'modificator-value');
     $this->_locatorHelper->shouldReceive('getBlockLocator')->with('block-name', 'modificator-name', 'modificator-value')->once()->andReturn('OK');
     $this->assertEquals('OK', $this->_annotation->getSelector($this->_locatorHelper));
 }
コード例 #2
0
 /**
  * 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);
 }
コード例 #3
0
 public function testGetElementLocator()
 {
     $this->_locatorHelper->shouldReceive('getElementLocator')->with('element-name', 'block-name', 'modificator-name', 'modificator-value')->once()->andReturn('OK');
     $this->assertEquals('OK', $this->locator->getElementLocator('element-name', 'block-name', 'modificator-name', 'modificator-value'));
 }
コード例 #4
0
 /**
  * Returns element locator.
  *
  * @param string      $element_name      Element name.
  * @param string      $block_name        Block name.
  * @param string|null $modificator_name  Modificator name.
  * @param string|null $modificator_value Modificator value.
  *
  * @return array
  */
 public function getElementLocator($element_name, $block_name, $modificator_name = null, $modificator_value = null)
 {
     return $this->_helper->getElementLocator($element_name, $block_name, $modificator_name, $modificator_value);
 }
コード例 #5
0
 public function testGetElementLocatorWithModificator()
 {
     $locator = $this->_locatorHelper->getElementLocator('element-name', 'block-name', 'modificator-name', 'modificator-value');
     $this->_assertLocatorClassName($locator, 'block-name__element-name_modificator-name_modificator-value');
 }