function DependencyTest::testEnableWithoutDependency

Attempts to enable the Entity Translation module without Language enabled.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Module/DependencyTest.php, line 25
Definition of Drupal\system\Tests\Module\DependencyTest.

Class

DependencyTest
Tests module dependency functionality.

Namespace

Drupal\system\Tests\Module

Code

function testEnableWithoutDependency() {

  // Attempt to enable Entity Translation without Language enabled.
  $edit = array();
  $edit['modules[Multilingual][translation_entity][enable]'] = 'translation_entity';
  $this
    ->drupalPost('admin/modules', $edit, t('Save configuration'));
  $this
    ->assertText(t('Some required modules must be enabled'), 'Dependency required.');
  $this
    ->assertModules(array(
    'translation_entity',
    'language',
  ), FALSE);

  // Assert that the language tables weren't enabled.
  $this
    ->assertTableCount('language', FALSE);
  $this
    ->drupalPost(NULL, NULL, t('Continue'));
  $this
    ->assertText(t('The configuration options have been saved.'), 'Modules status has been updated.');
  $this
    ->assertModules(array(
    'translation_entity',
    'language',
  ), TRUE);

  // Assert that the language tables were enabled.
  $this
    ->assertTableCount('language', TRUE);
}