t('api_link_code()'),
'description' => t('Test the api_link_code() function.'),
'group' => 'API Module',
);
}
function testApiLinkCode() {
$tests = array(
// Should be linked
array(
'message' => 'Marked-up function name linking',
'data' => 'sample_function',
'expected' => 'sample_function',
),
// Should not be linked
array(
'message' => 'Function name linking',
'data' => 'sample_function',
'expected' => 'sample_function',
),
array(
'message' => 'Function name linking with (',
'data' => 'sample_function(',
'expected' => 'sample_function(',
),
);
foreach ($tests as $test) {
$result = api_link_code($test['data'], '6');
$this->assertEqual($result, $test['expected'], $test['message']);
}
}
}