class PackageManagementTest in MongoDB 7
Same name in this branch
- 7 src/Tests/PackageManagementTest.php \Drupal\mongodb\Tests\PackageManagementTest
- 7 mongodb_watchdog/src/Tests/PackageManagementTest.php \Drupal\mongodb_watchdog\Tests\PackageManagementTest
Test package management hooks.
This test is about install/enable/disable/uninstall operations.
@group MongoDB: Base
Hierarchy
- class \Drupal\mongodb\Tests\PackageManagementTest extends \Drupal\mongodb\Tests\DrupalWebTestCase
Expanded class hierarchy of PackageManagementTest
File
- src/
Tests/ PackageManagementTest.php, line 12
Namespace
Drupal\mongodb\TestsView source
class PackageManagementTest extends \DrupalWebTestCase {
const MODULE = 'mongodb';
/**
* {@inheritdoc}
*/
public static function getInfo() {
return array(
'name' => 'MongoDB package management test',
'description' => 'install/enable/disable/uninstall operations.',
'group' => 'MongoDB: Base',
);
}
/**
* {@inheritdoc}
*/
public function setUp() {
// Support using the MongoDB cache.
drupal_flush_all_caches();
parent::setUp();
}
/**
* {@inheritdoc}
*/
public function tearDown() {
// Support using the MongoDB cache.
drupal_flush_all_caches();
parent::tearDown();
}
/**
* Test successful execution of hook_requirements() during install/enable.
*
* Function module_enable() does not check requirements, unlike normal
* enabling, so we need to invoke the hook manually to simulate it.
*/
public function testEnable() {
module_load_install(static::MODULE);
module_invoke(static::MODULE, 'requirements', 'install');
module_enable([
static::MODULE,
], FALSE);
$this
->pass('Successfully enabled mongodb.module.');
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PackageManagementTest:: |
public static | function | ||
PackageManagementTest:: |
constant | |||
PackageManagementTest:: |
public | function | ||
PackageManagementTest:: |
public | function | ||
PackageManagementTest:: |
public | function | Test successful execution of hook_requirements() during install/enable. |