function CtoolsContextIDTestCase::testContextIdName

Test ctools_context_id where the context has an id and a name.

File

tests/context.test, line 99

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);
}