Loading core/lib/Drupal/Core/Test/TestSetupTrait.php +14 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,20 @@ trait TestSetupTrait { */ protected $kernel; /** * The database prefix of this test run. * * @var string */ protected $databasePrefix; /** * The app root. * * @var string */ protected $root; /** * The temporary file directory for the test environment. * Loading core/tests/Drupal/TestSite/Commands/TestSiteInstallCommand.php +0 −7 Original line number Diff line number Diff line Loading @@ -46,13 +46,6 @@ class TestSiteInstallCommand extends Command { */ protected $timeLimit = 500; /** * The database prefix of this test run. * * @var string */ protected $databasePrefix; /** * The language to install the site in. * Loading core/tests/Drupal/Tests/BrowserTestBase.php +0 −14 Original line number Diff line number Diff line Loading @@ -75,13 +75,6 @@ abstract class BrowserTestBase extends TestCase { use ExpectDeprecationTrait; use ExtensionListTestTrait; /** * The database prefix of this test run. * * @var string */ protected $databasePrefix; /** * Time limit in seconds for the test. * Loading Loading @@ -203,13 +196,6 @@ abstract class BrowserTestBase extends TestCase { */ protected $originalShutdownCallbacks = []; /** * The app root. * * @var string */ protected $root; /** * The original container. * Loading core/tests/Drupal/Tests/Core/Test/TestSetupTraitTest.php +8 −2 Original line number Diff line number Diff line Loading @@ -35,8 +35,14 @@ public function testChangeDatabasePrefix() { // Create a mock for testing the trait and set a few properties that are // used to avoid unnecessary set up. $test_setup = $this->getMockForTrait(TestSetupTrait::class); $test_setup->databasePrefix = 'testDbPrefix'; $test_setup->root = $root; $reflection = new \ReflectionClass($test_setup); $property = $reflection->getProperty('databasePrefix'); $property->setAccessible(TRUE); $property->setValue($test_setup, 'testDbPrefix'); $property = $reflection->getProperty('root'); $property->setAccessible(TRUE); $property->setValue($test_setup, $root); $method = new \ReflectionMethod(get_class($test_setup), 'changeDatabasePrefix'); $method->setAccessible(TRUE); Loading Loading
core/lib/Drupal/Core/Test/TestSetupTrait.php +14 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,20 @@ trait TestSetupTrait { */ protected $kernel; /** * The database prefix of this test run. * * @var string */ protected $databasePrefix; /** * The app root. * * @var string */ protected $root; /** * The temporary file directory for the test environment. * Loading
core/tests/Drupal/TestSite/Commands/TestSiteInstallCommand.php +0 −7 Original line number Diff line number Diff line Loading @@ -46,13 +46,6 @@ class TestSiteInstallCommand extends Command { */ protected $timeLimit = 500; /** * The database prefix of this test run. * * @var string */ protected $databasePrefix; /** * The language to install the site in. * Loading
core/tests/Drupal/Tests/BrowserTestBase.php +0 −14 Original line number Diff line number Diff line Loading @@ -75,13 +75,6 @@ abstract class BrowserTestBase extends TestCase { use ExpectDeprecationTrait; use ExtensionListTestTrait; /** * The database prefix of this test run. * * @var string */ protected $databasePrefix; /** * Time limit in seconds for the test. * Loading Loading @@ -203,13 +196,6 @@ abstract class BrowserTestBase extends TestCase { */ protected $originalShutdownCallbacks = []; /** * The app root. * * @var string */ protected $root; /** * The original container. * Loading
core/tests/Drupal/Tests/Core/Test/TestSetupTraitTest.php +8 −2 Original line number Diff line number Diff line Loading @@ -35,8 +35,14 @@ public function testChangeDatabasePrefix() { // Create a mock for testing the trait and set a few properties that are // used to avoid unnecessary set up. $test_setup = $this->getMockForTrait(TestSetupTrait::class); $test_setup->databasePrefix = 'testDbPrefix'; $test_setup->root = $root; $reflection = new \ReflectionClass($test_setup); $property = $reflection->getProperty('databasePrefix'); $property->setAccessible(TRUE); $property->setValue($test_setup, 'testDbPrefix'); $property = $reflection->getProperty('root'); $property->setAccessible(TRUE); $property->setValue($test_setup, $root); $method = new \ReflectionMethod(get_class($test_setup), 'changeDatabasePrefix'); $method->setAccessible(TRUE); Loading