You are here

public function FieldablePanelsPanesSubContext::assertRevisionCount in Panopoly 7

@Then fieldable panels pane :admin_title should have :expected_count revision(s)

@todo: Can we only allow this to work with @api tests?

File

modules/panopoly/panopoly_test/behat/steps/panopoly_test_fpp.behat.inc, line 136
Provide Behat step-definitions for Fieldable Panels Panes.

Class

FieldablePanelsPanesSubContext

Code

public function assertRevisionCount($admin_title, $expected_count) {
  $fpp = $this
    ->getFPPByAdminTitle($admin_title);
  $revisions = $this
    ->getFPPRevisions($fpp->fpid);
  $actual_count = count($revisions);
  if ($actual_count != $expected_count) {
    throw new \Exception(sprintf('Fieldable panels pane "%s" has %s revisions (rather than the expected %s)', $admin_title, $actual_count, $expected_count));
  }
}