Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / simpletest / tests / src / Functional / OtherInstallationProfileTestsTest.php
1 <?php
2
3 namespace Drupal\Tests\simpletest\Functional;
4
5 use Drupal\Tests\BrowserTestBase;
6
7 /**
8  * Verifies that tests in other installation profiles are found.
9  *
10  * @group simpletest
11  * @see \Drupal\simpletest\Tests\InstallationProfileModuleTestsTest
12  */
13 class OtherInstallationProfileTestsTest extends BrowserTestBase {
14
15   /**
16    * Modules to enable.
17    *
18    * @var array
19    */
20   public static $modules = ['simpletest'];
21
22   /**
23    * Use the Minimal profile.
24    *
25    * The Testing profile contains drupal_system_listing_compatible_test.test,
26    * which should be found.
27    *
28    * The Standard profile contains \Drupal\standard\Tests\StandardTest, which
29    * should be found.
30    *
31    * @var string
32    *
33    * @see \Drupal\simpletest\Tests\InstallationProfileModuleTestsTest
34    * @see \Drupal\Tests\drupal_system_listing_compatible_test\Kernel\SystemListingCrossProfileCompatibleTest
35    */
36   protected $profile = 'minimal';
37
38   /**
39    * An administrative user with permission to administer unit tests.
40    *
41    * @var \Drupal\user\UserInterface
42    */
43   protected $adminUser;
44
45   protected function setUp() {
46     parent::setUp();
47
48     $this->adminUser = $this->drupalCreateUser(['administer unit tests']);
49     $this->drupalLogin($this->adminUser);
50   }
51
52   /**
53    * Tests that tests located in another installation profile appear.
54    */
55   public function testOtherInstallationProfile() {
56     // Assert the existence of a test in a different installation profile than
57     // the current.
58     $this->drupalGet('admin/config/development/testing');
59     $this->assertText('Tests Standard installation profile expectations.');
60
61     // Assert the existence of a test for a module in a different installation
62     // profile than the current.
63     $this->assertText('Drupal\Tests\drupal_system_listing_compatible_test\Kernel\SystemListingCrossProfileCompatibleTest');
64   }
65
66 }