public function ViewModePageTestCase::testDeletePattern in View Mode Page 7.2
Same name and namespace in other branches
- 8.2 view_mode_page.test \ViewModePageTestCase::testDeletePattern()
Test deleting a pattern with the non-entity based function
File
- ./
view_mode_page.test, line 103
Class
- ViewModePageTestCase
- Tests
Code
public function testDeletePattern() {
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_patterns('blog_post');
$this
->assertNumberOfPatterns(1);
}