Unverified Commit 6ae83e17 authored by alexpott's avatar alexpott
Browse files

Issue #2982740 by ApacheEx, Lendude, alexpott: Convert...

Issue #2982740 by ApacheEx, Lendude, alexpott: Convert \Drupal\drupal_system_listing_compatible_test\Tests\SystemListingCompatibleTest to KernelTestBase
parent 78699bad
......@@ -35,7 +35,7 @@ class InstallationProfileModuleTestsTest extends WebTestBase {
* - but still install the drupal_system_listing_compatible_test.module
* contained in the Testing profile.
*
* @see \Drupal\drupal_system_listing_compatible_test\Tests\SystemListingCompatibleTest
* @see \Drupal\Tests\drupal_system_listing_compatible_test\Kernel\SystemListingCompatibleTest
*
* @var string
*/
......@@ -53,12 +53,18 @@ protected function setUp() {
*/
public function testInstallationProfileTests() {
$this->drupalGet('admin/config/development/testing');
$this->assertText('Drupal\drupal_system_listing_compatible_test\Tests\SystemListingCompatibleTest');
$this->assertText('Drupal\Tests\drupal_system_listing_compatible_test\Kernel\SystemListingCompatibleTest');
$edit = [
'tests[Drupal\drupal_system_listing_compatible_test\Tests\SystemListingCompatibleTest]' => TRUE,
'tests[Drupal\Tests\drupal_system_listing_compatible_test\Kernel\SystemListingCompatibleTest]' => TRUE,
];
$this->drupalPostForm(NULL, $edit, t('Run tests'));
$this->assertText('SystemListingCompatibleTest test executed.');
// 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\SystemListingCompatibleTest',
]);
$this->assertTrue(!empty($element));
}
}
......@@ -8,7 +8,7 @@
* Verifies that tests in other installation profiles are found.
*
* @group simpletest
* @see SimpleTestInstallationProfileModuleTestsTestCase
* @see \Drupal\simpletest\Tests\InstallationProfileModuleTestsTest
*/
class OtherInstallationProfileTestsTest extends BrowserTestBase {
......@@ -31,7 +31,7 @@ class OtherInstallationProfileTestsTest extends BrowserTestBase {
* @var string
*
* @see \Drupal\simpletest\Tests\InstallationProfileModuleTestsTest
* @see \Drupal\drupal_system_listing_compatible_test\Tests\SystemListingCompatibleTest
* @see \Drupal\Tests\drupal_system_listing_compatible_test\Kernel\SystemListingCompatibleTest
*/
protected $profile = 'minimal';
......@@ -60,7 +60,7 @@ public function testOtherInstallationProfile() {
// Assert the existence of a test for a module in a different installation
// profile than the current.
$this->assertText('Drupal\drupal_system_listing_compatible_test\Tests\SystemListingCompatibleTest');
$this->assertText('Drupal\Tests\drupal_system_listing_compatible_test\Kernel\SystemListingCompatibleTest');
}
}
<?php
namespace Drupal\drupal_system_listing_compatible_test\Tests;
namespace Drupal\Tests\drupal_system_listing_compatible_test\Kernel;
use Drupal\simpletest\WebTestBase;
use Drupal\KernelTests\KernelTestBase;
/**
* Verifies that tests in installation profile modules are found and may use
......@@ -10,7 +10,7 @@
*
* @group drupal_system_listing_compatible_test
*/
class SystemListingCompatibleTest extends WebTestBase {
class SystemListingCompatibleTest extends KernelTestBase {
/**
* Attempt to enable a module from the Testing profile.
......@@ -28,17 +28,26 @@ class SystemListingCompatibleTest extends WebTestBase {
* This test needs to use a different installation profile than the test which
* asserts that this test is found.
*
* @see SimpleTestInstallationProfileModuleTestsTestCase
* @see \Drupal\simpletest\Tests\InstallationProfileModuleTestsTest
*
* @var string
*/
protected $profile = 'minimal';
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->setInstallProfile($this->profile);
}
/**
* Non-empty test* method required to executed the test case class.
*/
public function testSystemListing() {
$this->pass(__CLASS__ . ' test executed.');
$this->assertTrue(TRUE, __CLASS__ . ' test executed.');
}
}
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