3 namespace Drupal\simpletest\Tests;
5 use Drupal\simpletest\WebTestBase;
8 * Verifies that tests bundled with installation profile modules are found.
12 class InstallationProfileModuleTestsTest extends WebTestBase {
19 public static $modules = ['simpletest'];
22 * An administrative user with permission to administer unit tests.
24 * @var \Drupal\user\UserInterface
29 * Use the Testing profile.
31 * The Testing profile contains drupal_system_listing_compatible_test.test,
33 * - run tests using the Minimal profile (which does not contain the
34 * drupal_system_listing_compatible_test.module)
35 * - but still install the drupal_system_listing_compatible_test.module
36 * contained in the Testing profile.
38 * @see \Drupal\Tests\drupal_system_listing_compatible_test\Kernel\SystemListingCrossProfileCompatibleTest
42 protected $profile = 'testing';
44 protected function setUp() {
47 $this->adminUser = $this->drupalCreateUser(['administer unit tests']);
48 $this->drupalLogin($this->adminUser);
52 * Tests existence of test case located in an installation profile module.
54 public function testInstallationProfileTests() {
55 $this->drupalGet('admin/config/development/testing');
56 $this->assertText('Drupal\Tests\drupal_system_listing_compatible_test\Kernel\SystemListingCrossProfileCompatibleTest');
58 'tests[Drupal\Tests\drupal_system_listing_compatible_test\Kernel\SystemListingCrossProfileCompatibleTest]' => TRUE,
60 $this->drupalPostForm(NULL, $edit, t('Run tests'));
62 // Verifies that tests in installation profile modules are passed.
63 $element = $this->xpath('//tr[contains(@class, :class)]/td[contains(text(), :value)]', [
64 ':class' => 'simpletest-pass',
65 ':value' => 'Drupal\Tests\drupal_system_listing_compatible_test\Kernel\SystemListingCrossProfileCompatibleTest',
67 $this->assertTrue(!empty($element));