Issue #3298906 by andypost, alexpott: Fix \Drupal\Tests\Core\Test\TestSetupTraitTest::testChangeDatabasePrefix() on PHP 8.2
parent
4024e3c478
commit
471e827a09
|
@ -80,6 +80,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.
|
||||
*
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -73,13 +73,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.
|
||||
*
|
||||
|
@ -201,13 +194,6 @@ abstract class BrowserTestBase extends TestCase {
|
|||
*/
|
||||
protected $originalShutdownCallbacks = [];
|
||||
|
||||
/**
|
||||
* The app root.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $root;
|
||||
|
||||
/**
|
||||
* The original container.
|
||||
*
|
||||
|
|
|
@ -35,8 +35,10 @@ class TestSetupTraitTest extends UnitTestCase {
|
|||
// 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);
|
||||
$reflection->getProperty('databasePrefix')->setValue($test_setup, 'testDbPrefix');
|
||||
$reflection->getProperty('root')->setValue($test_setup, $root);
|
||||
|
||||
$method = new \ReflectionMethod(get_class($test_setup), 'changeDatabasePrefix');
|
||||
$method->setAccessible(TRUE);
|
||||
|
|
Loading…
Reference in New Issue