You are here

public function ViewModePageTestCase::testAddEntityPattern in View Mode Page 8.2

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

Test adding a pattern with the entity based function

File

./view_mode_page.test, line 64

Class

ViewModePageTestCase
Tests

Code

public function testAddEntityPattern() {

  // make sure we have no patterns
  $this
    ->assertNumberOfPatterns(0);

  // add a pattern
  view_mode_page_add_entity_pattern(array(
    'entity_type' => 'node',
    'content_type' => 'blog_post',
    'view_mode' => 'teaser',
    'url_pattern' => 'blog/%/teaser',
  ));

  // make sure we have 1 pattern
  $this
    ->assertNumberOfPatterns(1);

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