updated core to 7.80
This commit is contained in:
@@ -1677,15 +1677,12 @@ class DrupalWebTestCase extends DrupalTestCase {
|
||||
file_unmanaged_delete_recursive($this->originalFileDirectory . '/simpletest/' . substr($this->databasePrefix, 10));
|
||||
|
||||
// Remove all prefixed tables.
|
||||
$tables = db_find_tables($this->databasePrefix . '%');
|
||||
$connection_info = Database::getConnectionInfo('default');
|
||||
$tables = db_find_tables($connection_info['default']['prefix']['default'] . '%');
|
||||
$tables = db_find_tables_d8('%');
|
||||
if (empty($tables)) {
|
||||
$this->fail('Failed to find test tables to drop.');
|
||||
}
|
||||
$prefix_length = strlen($connection_info['default']['prefix']['default']);
|
||||
foreach ($tables as $table) {
|
||||
if (db_drop_table(substr($table, $prefix_length))) {
|
||||
if (db_drop_table($table)) {
|
||||
unset($tables[$table]);
|
||||
}
|
||||
}
|
||||
@@ -1693,8 +1690,14 @@ class DrupalWebTestCase extends DrupalTestCase {
|
||||
$this->fail('Failed to drop all prefixed tables.');
|
||||
}
|
||||
|
||||
// In PHP 8 some tests encounter problems when shutdown code tries to
|
||||
// access the database connection after it's been explicitly closed, for
|
||||
// example the destructor of DrupalCacheArray. We avoid this by not fully
|
||||
// destroying the test database connection.
|
||||
$close = \PHP_VERSION_ID < 80000;
|
||||
|
||||
// Get back to the original connection.
|
||||
Database::removeConnection('default');
|
||||
Database::removeConnection('default', $close);
|
||||
Database::renameConnection('simpletest_original_default', 'default');
|
||||
|
||||
// Restore original shutdown callbacks array to prevent original
|
||||
@@ -3087,7 +3090,7 @@ class DrupalWebTestCase extends DrupalTestCase {
|
||||
* @return
|
||||
* TRUE on pass, FALSE on fail.
|
||||
*/
|
||||
protected function assertTextHelper($text, $message = '', $group, $not_exists) {
|
||||
protected function assertTextHelper($text, $message, $group, $not_exists) {
|
||||
if ($this->plainTextContent === FALSE) {
|
||||
$this->plainTextContent = filter_xss($this->drupalGetContent(), array());
|
||||
}
|
||||
@@ -3153,7 +3156,7 @@ class DrupalWebTestCase extends DrupalTestCase {
|
||||
* @return
|
||||
* TRUE on pass, FALSE on fail.
|
||||
*/
|
||||
protected function assertUniqueTextHelper($text, $message = '', $group, $be_unique) {
|
||||
protected function assertUniqueTextHelper($text, $message, $group, $be_unique) {
|
||||
if ($this->plainTextContent === FALSE) {
|
||||
$this->plainTextContent = filter_xss($this->drupalGetContent(), array());
|
||||
}
|
||||
@@ -3259,7 +3262,7 @@ class DrupalWebTestCase extends DrupalTestCase {
|
||||
* @param $callback
|
||||
* The name of the theme function to invoke; e.g. 'links' for theme_links().
|
||||
* @param $variables
|
||||
* (optional) An array of variables to pass to the theme function.
|
||||
* An array of variables to pass to the theme function.
|
||||
* @param $expected
|
||||
* The expected themed output string.
|
||||
* @param $message
|
||||
@@ -3275,7 +3278,7 @@ class DrupalWebTestCase extends DrupalTestCase {
|
||||
* @return
|
||||
* TRUE on pass, FALSE on fail.
|
||||
*/
|
||||
protected function assertThemeOutput($callback, array $variables = array(), $expected, $message = '', $group = 'Other') {
|
||||
protected function assertThemeOutput($callback, array $variables, $expected, $message = '', $group = 'Other') {
|
||||
$output = theme($callback, $variables);
|
||||
$this->verbose('Variables:' . '<pre>' . check_plain(var_export($variables, TRUE)) . '</pre>'
|
||||
. '<hr />' . 'Result:' . '<pre>' . check_plain(var_export($output, TRUE)) . '</pre>'
|
||||
|
Reference in New Issue
Block a user