protected function GeshiFilterTest::createTextFormat in GeSHi Filter for syntax highlighting 7
Create a new text format.
Parameters
string $format_name: The name of new text format.
array $filters: Array with the machine names of filters to enable.
1 call to GeshiFilterTest::createTextFormat()
- GeshiFilterTest::setUp in ./
geshifilter.test - SimpleTest core method: code run before each and every test method.
File
- ./
geshifilter.test, line 234 - Tests for the GeSHi filter module.
Class
- GeshiFilterTest
- Funcional tests for the GeSHi filter node content.
Code
protected function createTextFormat($format_name, $filters) {
$edit = array();
$edit['format'] = $format_name;
$edit['name'] = $this
->randomName();
$edit['roles[' . DRUPAL_AUTHENTICATED_RID . ']'] = 1;
foreach ($filters as $filter) {
$edit['filters[' . $filter . '][status]'] = TRUE;
}
$this
->drupalPost('admin/config/content/formats/add', $edit, t('Save configuration'));
$this
->assertRaw(t('Added text format %format.', array(
'%format' => $edit['name'],
)), 'New filter created.');
$this
->drupalGet('admin/config/content/formats');
}