Created
October 9, 2012 00:36
-
-
Save sun/3855847 to your computer and use it in GitHub Desktop.
ModuleEnable test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* Contains Drupal\system\Tests\Module\ModuleEnable. | |
*/ | |
namespace Drupal\system\Tests\Module; | |
use Drupal\simpletest\WebTestBase; | |
/** | |
* Tests module_enable(). | |
*/ | |
class ModuleEnable extends WebTestBase { | |
public static function getInfo() { | |
return array( | |
'name' => 'Module enable', | |
'description' => 'Tests module_enable().', | |
'group' => 'Module', | |
); | |
} | |
/** | |
* Tests two subsequent calls to module_enable() for the same module. | |
*/ | |
function testSubsequentWithDependencies() { | |
$this->assertFalse(module_exists('module_test')); | |
module_enable(array('module_test')); | |
$this->assertTrue(module_exists('module_test')); | |
$this->assertIdentical(config('system.module')->get('enabled.module_test'), '0'); | |
module_enable(array('module_test')); | |
$this->assertTrue(module_exists('module_test')); | |
$this->assertIdentical(config('system.module')->get('enabled.module_test'), '0'); | |
} | |
/** | |
* Tests two subsequent calls to module_enable() for the same module. | |
*/ | |
function testSubsequentWithoutDependencies() { | |
$this->assertFalse(module_exists('module_test')); | |
module_enable(array('module_test'), FALSE); | |
$this->assertTrue(module_exists('module_test')); | |
$this->assertIdentical(config('system.module')->get('enabled.module_test'), '0'); | |
module_enable(array('module_test'), FALSE); | |
$this->assertTrue(module_exists('module_test')); | |
$this->assertIdentical(config('system.module')->get('enabled.module_test'), '0'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment