You are here

public function OgMenuSubContext::assertMenuItemCount in Organic Groups Menu (OG Menu) 8

Checks that the given OG Menu instance has the expected number of items.

@Then the :menu menu of the :group group of type :type should have :count item(s)

Parameters

string $menu: The name of the OG Menu instance to check.

string $label: The group label.

string $type: The group type, either 'collection' or 'solution'.

int $count: The expected number of items in the menu.

File

./og_menu.behat.inc, line 33
Contains \OgMenuSubContext.

Class

OgMenuSubContext
Behat step definitions for testing OG Menus.

Code

public function assertMenuItemCount($menu, $label, $type, $count) {
  $group = $this
    ->getEntityByLabel($type, $label);
  $menu_instance = $this
    ->getOgMenuInstance($group
    ->id(), $menu);
  $tree = $this
    ->getOgMenuTree($menu_instance);
  PHPUnit_Framework_Assert::assertEquals($count, count($tree));
}