public function CtoolsContextIDTestCase::testContextIdName in Chaos Tool Suite (ctools) 7
Test ctools_context_id where the context has an id and a name.
File
- tests/
context.test, line 99 - Test the keyword substitution functionality.
Class
- CtoolsContextIDTestCase
- @file Test the keyword substitution functionality.
Code
public function testContextIdName() {
$context = array(
'id' => '512',
'name' => 'foo',
);
$expected = 'context_foo_512';
$this
->assertEqual(ctools_context_id($context), $expected, 'Context "512"/"foo" has id ' . $expected);
$context = array(
'id' => '512',
'name' => 'foo_bar',
);
$expected = 'context_foo_bar_512';
$this
->assertEqual(ctools_context_id($context), $expected, 'Context "512"/"foo_bar" has id ' . $expected);
}