function ModernizrUnitTestCase::testModernizrInfo in Modernizr 7.3
Same name and namespace in other branches
- 8 tests/modernizr.test \ModernizrUnitTestCase::testModernizrInfo()
Tests that Modernizr is implementing hook_modernizr_info() correctly.
File
- tests/
modernizr.test, line 34 - Tests for Modernizr module.
Class
- ModernizrUnitTestCase
- Tests basic Modernizr API functions.
Code
function testModernizrInfo() {
global $conf;
// By default there are no tests
$tests = modernizr_modernizr_info();
if (is_array($tests)) {
$this
->assertEqual(count($tests), 0, 'No tests by default');
}
else {
$this
->fail('modernizr_modernizr_info returns an array');
}
// Now we require the printshiv test.
$conf['modernizr_cb_printshiv'] = TRUE;
$tests = modernizr_modernizr_info();
if (is_array($tests)) {
$test = array_shift($tests);
$this
->assertEqual($test, 'printshiv', 'printshiv test enabled');
}
else {
$this
->fail('modernizr_modernizr_info returns an array');
}
}