Exemple #1
0
 /**
  * @dataProvider modificatorDataProvider
  */
 public function testGetElementsEmpty($modificator_name, $modificator_value)
 {
     $this->_prepareSearchFixture(true);
     $this->_elementLocator->shouldReceive('getElementLocator')->with('element-name', 'block-name', $modificator_name, $modificator_value)->once()->andReturn($this->_locator);
     $block = $this->createPart();
     $nodes = $block->getElements('element-name', $modificator_name, $modificator_value);
     $this->assertCount(0, $nodes);
 }
Exemple #2
0
 /**
  * Returns all block elements.
  *
  * @param string $element_name      Element name.
  * @param string $modificator_name  Modificator name.
  * @param string $modificator_value Modificator value.
  *
  * @return NodeElement[]
  */
 public function getElements($element_name, $modificator_name = null, $modificator_value = null)
 {
     $locator = $this->_locator->getElementLocator($element_name, $this->getName(), $modificator_name, $modificator_value);
     return $this->findAll('se', $locator);
 }
 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'));
 }