function MobileToolsContextConditionMobileTest::test in Mobile Tools 7.2
File
- mobile_tools_context/
mobile_tools_context.test, line 27 - Tests for mobile_tools_context
Class
- MobileToolsContextConditionMobileTest
- @file Tests for mobile_tools_context
Code
function test() {
// Create the context
ctools_include('export');
$context = ctools_export_new_object('context');
$context->name = 'testcontext';
//$context->conditions = array('path' => array('values' => array('admin', 'node/*')));
// @todo configure conditions
$context->reactions = array(
'debug' => array(
'debug' => TRUE,
),
);
$saved = context_save($context);
$this
->assertTrue($saved, "Context 'testcontext' saved.");
// Configure the mobile tools settings to trigger the mobile context
// @todo
// With the debug mode on, Context will print to screen when the context is active
$this
->drupalGet('');
// @todo figure out what URL to go to test the context
$this
->assertText('Mobile context active: testcontext');
// Configure the mobile tools settings to not trigger the mobile context
// @todo
// @todo repeat tests from above
// Cleanup
context_delete($context);
// @todo: Test with language suffixes
}