09ec7b4dbc8c0583bcd70ebbcb96e221098c3370
[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 SimpleTestInstallationProfileModuleTestsTestCase
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    * @see \Drupal\simpletest\Tests\InstallationProfileModuleTestsTest
32    * @see \Drupal\drupal_system_listing_compatible_test\Tests\SystemListingCompatibleTest
33    */
34   protected $profile = 'minimal';
35
36   /**
37    * An administrative user with permission to administer unit tests.
38    *
39    * @var \Drupal\user\UserInterface
40    */
41   protected $adminUser;
42
43   protected function setUp() {
44     parent::setUp();
45
46     $this->adminUser = $this->drupalCreateUser(['administer unit tests']);
47     $this->drupalLogin($this->adminUser);
48   }
49
50   /**
51    * Tests that tests located in another installation profile appear.
52    */
53   public function testOtherInstallationProfile() {
54     // Assert the existence of a test in a different installation profile than
55     // the current.
56     $this->drupalGet('admin/config/development/testing');
57     $this->assertText('Tests Standard installation profile expectations.');
58
59     // Assert the existence of a test for a module in a different installation
60     // profile than the current.
61     $this->assertText('Drupal\drupal_system_listing_compatible_test\Tests\SystemListingCompatibleTest');
62   }
63
64 }