public function AjaxLoaderTestCase::testManager in Ajax loader 7
Test manager.
File
- ./
ajax_loader.test, line 37 - Test class to ensure proper working of module.
Class
- AjaxLoaderTestCase
- @file Test class to ensure proper working of module.
Code
public function testManager() {
$this
->assertFalse(ThrobberManager::isValidThrobber('ThrobberNotValid'), 'ThrobberNotValid is not valid throbber');
// Test all default throbbers.
$throbbers = ThrobberTypes::toArray();
foreach ($throbbers as $throbber => $label) {
$this
->assertTrue(ThrobberManager::isValidThrobber($throbber), $throbber . ' is valid throbber');
}
// Test user definied throbbers (non exiting ones).
$custom_throbbers['new_throbber'] = array(
'class' => 'MyNewThrobber',
);
$custom_throbbers['another_throbber'] = array(
'class' => 'AnotherThrobber',
);
$this
->assertEqual(count(ThrobberManager::processUserDefinedThrobbers($custom_throbbers)), 0, 'No valid custom throbbers');
// Now test a good one.
$custom_throbbers['test_throbber'] = array(
'class' => 'ThrobberTest',
);
$this
->assertEqual(count(ThrobberManager::processUserDefinedThrobbers($custom_throbbers)), 1, 'One valid custom throbber');
}