You are here

public function PanelizerContext::assertBlock in Lightning Layout 8

Asserts that a block is present in a specific region of a Panelizer layout.

@Then the :label block should be in the :region region

Parameters

string $label: The block label.

string $region: The machine name of the region in which the block is expected to be.

Return value

\Behat\Mink\Element\NodeElement The block's row in the table.

Throws

\Behat\Mink\Exception\ExpectationException If the block is not present as expected.

2 calls to PanelizerContext::assertBlock()
PanelizerContext::placeBlock in tests/contexts/PanelizerContext.behat.inc
Places a block into a Panelizer layout via the wizard.
PanelizerContext::removeBlock in tests/contexts/PanelizerContext.behat.inc
Removes a block from a Panelizer layout via the wizard.

File

tests/contexts/PanelizerContext.behat.inc, line 79

Class

PanelizerContext

Namespace

Acquia\LightningExtension\Context

Code

public function assertBlock($label, $region) {
  $row = $this
    ->getBlockRow($label, $region);
  if ($row) {
    return $row;
  }
  else {
    throw new ExpectationException("Expected block '{$label}' to be present in '{$region}' region.", $this
      ->getSession()
      ->getDriver());
  }
}