61656a86bdcc84b5245282a602de75ddaf9e0ce9
[yaffs-website] / web / core / profiles / testing / modules / drupal_system_listing_compatible_test / tests / src / Kernel / SystemListingCrossProfileCompatibleTest.php
1 <?php
2
3 namespace Drupal\Tests\drupal_system_listing_compatible_test\Kernel;
4
5 use Drupal\KernelTests\KernelTestBase;
6
7 /**
8  * Verifies that tests in installation profile modules are found and may use
9  * another profile for running tests.
10  *
11  * @group drupal_system_listing_compatible_test
12  */
13 class SystemListingCrossProfileCompatibleTest extends KernelTestBase {
14
15   /**
16    * Attempt to enable a module from the Testing profile.
17    *
18    * This test uses the Minimal profile, but enables a module from the Testing
19    * profile to confirm that a different profile can be used for running tests.
20    *
21    * @var array
22    */
23   public static $modules = ['drupal_system_cross_profile_test'];
24
25   /**
26    * Use the Minimal profile.
27    *
28    * This test needs to use a different installation profile than the test which
29    * asserts that this test is found.
30    *
31    * @see \Drupal\simpletest\Tests\InstallationProfileModuleTestsTest
32    *
33    * @var string
34    */
35   protected $profile = 'minimal';
36
37   /**
38    * {@inheritdoc}
39    */
40   protected function setUp() {
41     parent::setUp();
42
43     $this->setInstallProfile($this->profile);
44   }
45
46   /**
47    * Non-empty test* method required to executed the test case class.
48    */
49   public function testSystemListing() {
50     /** @var \Drupal\Core\Extension\ModuleHandlerInterface $module_handler */
51     $module_handler = $this->container->get('module_handler');
52     $this->assertTrue($module_handler->moduleExists('drupal_system_cross_profile_test'), 'Module installed from different profile');
53   }
54
55 }