052c0afb80028209cb8946a9be4435181f6b2ab6
[yaffs-website] / web / core / modules / system / tests / src / Kernel / Installer / InstallerMissingDependenciesTest.php
1 <?php
2
3 namespace Drupal\Tests\system\Kernel\Installer;
4
5 use Drupal\KernelTests\KernelTestBase;
6
7 /**
8  * Tests that we handle the absence of a module dependency during install.
9  *
10  * @group Installer
11  */
12 class InstallerMissingDependenciesTest extends KernelTestBase {
13
14   /**
15    * {@inheritdoc}
16    */
17   public static $modules = ['system'];
18
19   /**
20    * Verifies that the exception message in the profile step is correct.
21    */
22   public function testSetUpWithMissingDependencies() {
23     // Prime the drupal_get_filename() static cache with the location of the
24     // testing profile as it is not the currently active profile and we don't
25     // yet have any cached way to retrieve its location.
26     // @todo Remove as part of https://www.drupal.org/node/2186491
27     drupal_get_filename('profile', 'testing_missing_dependencies', 'core/profiles/testing_missing_dependencies/testing_missing_dependencies.info.yml');
28
29     $info = drupal_verify_profile([
30       'parameters' => ['profile' => 'testing_missing_dependencies'],
31       'profile_info' => install_profile_info('testing_missing_dependencies'),
32     ]);
33
34     $message = $info['required_modules']['description']->render();
35     $this->assertContains('Missing_module1', $message);
36     $this->assertContains('Missing_module2', $message);
37   }
38
39 }