protected function GeshiFilterAdministrationTest::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 GeshiFilterAdministrationTest::createTextFormat()
- GeshiFilterAdministrationTest::setUp in ./
geshifilter.test - SimpleTest core method: code run before each and every test method.
File
- ./
geshifilter.test, line 79 - Tests for the GeSHi filter module.
Class
- GeshiFilterAdministrationTest
- Funcional tests for the GeSHi filter administration.
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');
}