You are here

function ParagraphsPackFeatureWebTestCase::validate_view_mode_options in Paragraphs pack 7

Validate if all correct view modes are present.

Parameters

string $entity_type: The specified entity type.

array $view_modes: An array of view modes to validate.

1 call to ParagraphsPackFeatureWebTestCase::validate_view_mode_options()
ParagraphsPackFeatureWebTestCase::check_view_mode_options in tests/paragraphs_pack.test_helper.inc

File

tests/paragraphs_pack.test_helper.inc, line 146
Paragraphs pack content module's tests.

Class

ParagraphsPackFeatureWebTestCase
Class ParagraphsPackWebTestCase

Code

function validate_view_mode_options($entity_type, $view_modes) {
  $all_view_modes_are_present = TRUE;
  foreach (paragraphs_pack_get_entity_type_view_modes($entity_type) as $machine_name => $label) {
    if (!in_array($machine_name, $view_modes)) {
      $all_view_modes_are_present = FALSE;
    }
  }
  $this
    ->assertTrue($all_view_modes_are_present, t('All correct view modes are present.'));
}