You are here

public function ViewModePageTestCase::testDeleteEntityPattern in View Mode Page 8.2

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

Test deleting a pattern with the entity based function

File

./view_mode_page.test, line 129

Class

ViewModePageTestCase
Tests

Code

public function testDeleteEntityPattern() {
  view_mode_page_add_entity_pattern(array(
    'entity_type' => 'node',
    'content_type' => 'blog_post',
    'view_mode' => 'teaser',
    'url_pattern' => 'blog/%/teaser',
  ));
  view_mode_page_add_entity_pattern(array(
    'entity_type' => 'node',
    'content_type' => 'person',
    'view_mode' => 'teaser',
    'url_pattern' => 'person/%/teaser',
  ));

  // check out pattern
  $this
    ->assertEntityPattern('node', 'blog_post', 'teaser', 'blog/%/teaser');

  // delete the pattern
  view_mode_page_delete_entity_patterns('node', 'blog_post');
  $this
    ->assertNumberOfPatterns(1);
}