Unverified Commit 9b4ce9a0 authored by alexpott's avatar alexpott

Issue #2984135 by vijaycs85, Lendude, alexpott: SystemListingCompatibleTest...

Issue #2984135 by vijaycs85, Lendude, alexpott: SystemListingCompatibleTest isn't testing what it says anymore
parent 2650c434
...@@ -35,7 +35,7 @@ class InstallationProfileModuleTestsTest extends WebTestBase { ...@@ -35,7 +35,7 @@ class InstallationProfileModuleTestsTest extends WebTestBase {
* - but still install the drupal_system_listing_compatible_test.module * - but still install the drupal_system_listing_compatible_test.module
* contained in the Testing profile. * contained in the Testing profile.
* *
* @see \Drupal\Tests\drupal_system_listing_compatible_test\Kernel\SystemListingCompatibleTest * @see \Drupal\Tests\drupal_system_listing_compatible_test\Kernel\SystemListingCrossProfileCompatibleTest
* *
* @var string * @var string
*/ */
...@@ -53,16 +53,16 @@ protected function setUp() { ...@@ -53,16 +53,16 @@ protected function setUp() {
*/ */
public function testInstallationProfileTests() { public function testInstallationProfileTests() {
$this->drupalGet('admin/config/development/testing'); $this->drupalGet('admin/config/development/testing');
$this->assertText('Drupal\Tests\drupal_system_listing_compatible_test\Kernel\SystemListingCompatibleTest'); $this->assertText('Drupal\Tests\drupal_system_listing_compatible_test\Kernel\SystemListingCrossProfileCompatibleTest');
$edit = [ $edit = [
'tests[Drupal\Tests\drupal_system_listing_compatible_test\Kernel\SystemListingCompatibleTest]' => TRUE, 'tests[Drupal\Tests\drupal_system_listing_compatible_test\Kernel\SystemListingCrossProfileCompatibleTest]' => TRUE,
]; ];
$this->drupalPostForm(NULL, $edit, t('Run tests')); $this->drupalPostForm(NULL, $edit, t('Run tests'));
// Verifies that tests in installation profile modules are passed. // Verifies that tests in installation profile modules are passed.
$element = $this->xpath('//tr[contains(@class, :class)]/td[contains(text(), :value)]', [ $element = $this->xpath('//tr[contains(@class, :class)]/td[contains(text(), :value)]', [
':class' => 'simpletest-pass', ':class' => 'simpletest-pass',
':value' => 'Drupal\Tests\drupal_system_listing_compatible_test\Kernel\SystemListingCompatibleTest', ':value' => 'Drupal\Tests\drupal_system_listing_compatible_test\Kernel\SystemListingCrossProfileCompatibleTest',
]); ]);
$this->assertTrue(!empty($element)); $this->assertTrue(!empty($element));
} }
......
...@@ -31,7 +31,7 @@ class OtherInstallationProfileTestsTest extends BrowserTestBase { ...@@ -31,7 +31,7 @@ class OtherInstallationProfileTestsTest extends BrowserTestBase {
* @var string * @var string
* *
* @see \Drupal\simpletest\Tests\InstallationProfileModuleTestsTest * @see \Drupal\simpletest\Tests\InstallationProfileModuleTestsTest
* @see \Drupal\Tests\drupal_system_listing_compatible_test\Kernel\SystemListingCompatibleTest * @see \Drupal\Tests\drupal_system_listing_compatible_test\Kernel\SystemListingCrossProfileCompatibleTest
*/ */
protected $profile = 'minimal'; protected $profile = 'minimal';
...@@ -60,7 +60,7 @@ public function testOtherInstallationProfile() { ...@@ -60,7 +60,7 @@ public function testOtherInstallationProfile() {
// Assert the existence of a test for a module in a different installation // Assert the existence of a test for a module in a different installation
// profile than the current. // profile than the current.
$this->assertText('Drupal\Tests\drupal_system_listing_compatible_test\Kernel\SystemListingCompatibleTest'); $this->assertText('Drupal\Tests\drupal_system_listing_compatible_test\Kernel\SystemListingCrossProfileCompatibleTest');
} }
} }
name: 'Drupal system cross profile test'
type: module
description: 'Support module for testing that a module in one profile can be reused in another profile.'
package: Testing
version: VERSION
core: 8.x
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* *
* @group drupal_system_listing_compatible_test * @group drupal_system_listing_compatible_test
*/ */
class SystemListingCompatibleTest extends KernelTestBase { class SystemListingCrossProfileCompatibleTest extends KernelTestBase {
/** /**
* Attempt to enable a module from the Testing profile. * Attempt to enable a module from the Testing profile.
...@@ -20,7 +20,7 @@ class SystemListingCompatibleTest extends KernelTestBase { ...@@ -20,7 +20,7 @@ class SystemListingCompatibleTest extends KernelTestBase {
* *
* @var array * @var array
*/ */
public static $modules = ['drupal_system_listing_compatible_test']; public static $modules = ['drupal_system_cross_profile_test'];
/** /**
* Use the Minimal profile. * Use the Minimal profile.
...@@ -47,7 +47,9 @@ protected function setUp() { ...@@ -47,7 +47,9 @@ protected function setUp() {
* Non-empty test* method required to executed the test case class. * Non-empty test* method required to executed the test case class.
*/ */
public function testSystemListing() { public function testSystemListing() {
$this->assertTrue(TRUE, __CLASS__ . ' test executed.'); /** @var \Drupal\Core\Extension\ModuleHandlerInterface $module_handler */
$module_handler = $this->container->get('module_handler');
$this->assertTrue($module_handler->moduleExists('drupal_system_cross_profile_test'), 'Module installed from different profile');
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment