public function ViewModePageTestCase::assertNumberOfPatterns in View Mode Page 8.2
Same name and namespace in other branches
- 7.2 view_mode_page.test \ViewModePageTestCase::assertNumberOfPatterns()
Make sure the number of patterns in the database are what we expect
Parameters
int $number: Number of patterns
4 calls to ViewModePageTestCase::assertNumberOfPatterns()
- ViewModePageTestCase::testAddEntityPattern in ./
view_mode_page.test - Test adding a pattern with the entity based function
- ViewModePageTestCase::testAddPattern in ./
view_mode_page.test - Test adding a pattern with the non-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 32
Class
- ViewModePageTestCase
- Tests
Code
public function assertNumberOfPatterns($number) {
$patterns = view_mode_page_get_entity_patterns();
$term = 'patterns';
if ($number == 1) {
$term = 'pattern';
}
$this
->assertEqual(count($patterns), $number, 'There should be ' . $number . ' ' . $term . ', found: ' . count($patterns));
}