function ActivityAPITest::testActivityGetInfo in Activity 5.2
Same name and namespace in other branches
- 5.4 tests/ActivityAPITests.test \ActivityAPITest::testActivityGetInfo()
- 5.3 tests/ActivityAPITests.test \ActivityAPITest::testActivityGetInfo()
- 6 tests/ActivityAPITests.test \ActivityAPITest::testActivityGetInfo()
File
- tests/
ActivityAPITests.test, line 29
Class
Code
function testActivityGetInfo() {
$this
->drupalModuleEnable('nodeactivity');
// Assert that the api function activity_get_info exists
if ($this
->assertTrue(function_exists('activity_get_info'), '%s ' . t('Asserting that activity_get_info exists'))) {
// It exists. Let's call it.
$info = activity_get_info();
// The API's contract is to return an array.
$this
->assertTrue(is_array($info), '%s ' . t('Assrting that return value is an array.'));
// Assert that all of the modules we're looking for are in the array.
$this
->assertTrue(in_array('nodeactivity', array_keys($info)), '%s ' . t('Asserting that nodeactivity is one of the returned values.'));
}
}