adminUser = $this->drupalCreateUser(['administer unit tests']); $this->drupalLogin($this->adminUser); } /** * Tests existence of test case located in an installation profile module. */ public function testInstallationProfileTests() { $this->drupalGet('admin/config/development/testing'); $this->assertText('Drupal\Tests\drupal_system_listing_compatible_test\Kernel\SystemListingCrossProfileCompatibleTest'); $edit = [ 'tests[Drupal\Tests\drupal_system_listing_compatible_test\Kernel\SystemListingCrossProfileCompatibleTest]' => TRUE, ]; $this->drupalPostForm(NULL, $edit, t('Run tests')); // Verifies that tests in installation profile modules are passed. $element = $this->xpath('//tr[contains(@class, :class)]/td[contains(text(), :value)]', [ ':class' => 'simpletest-pass', ':value' => 'Drupal\Tests\drupal_system_listing_compatible_test\Kernel\SystemListingCrossProfileCompatibleTest', ]); $this->assertTrue(!empty($element)); } }