You are here

public function ViewModePageTestCase::assertEntityPattern in View Mode Page 8.2

Same name and namespace in other branches
  1. 7.2 view_mode_page.test \ViewModePageTestCase::assertEntityPattern()

Assert that an entity pattern exists as we intended

4 calls to ViewModePageTestCase::assertEntityPattern()
ViewModePageTestCase::assertPattern in ./view_mode_page.test
Assert that a pattern exists as we intended
ViewModePageTestCase::testAddEntityPattern in ./view_mode_page.test
Test adding a pattern with the entity based function
ViewModePageTestCase::testDeleteEntityPattern in ./view_mode_page.test
Test deleting a pattern with the entity based function
ViewModePageTestCase::testDeletePattern in ./view_mode_page.test
Test deleting a pattern with the non-entity based function

File

./view_mode_page.test, line 44

Class

ViewModePageTestCase
Tests

Code

public function assertEntityPattern($entity_type, $content_type, $view_mode, $url_pattern, $show_title = FALSE, $title = '') {
  $patterns = view_mode_page_get_entity_patterns($entity_type, $content_type, $view_mode);
  $this
    ->assertEqual(count($patterns), 1, 'There should be 1 pattern, found: ' . count($patterns));
  if (count($patterns) > 0) {
    $this
      ->assertEqual($patterns[0]->url_pattern, $url_pattern, 'The patterns do not match');
  }
}