Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
e014859c
Commit
e014859c
authored
Sep 27, 2016
by
catch
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2807171
by alexpott: Use the correct testing table prefix in simpletest_clean_database()
parent
68a880ab
No related branches found
No related tags found
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/modules/simpletest/simpletest.module
+5
-6
5 additions, 6 deletions
core/modules/simpletest/simpletest.module
with
5 additions
and
6 deletions
core/modules/simpletest/simpletest.module
+
5
−
6
View file @
e014859c
...
...
@@ -673,13 +673,12 @@ function simpletest_clean_environment() {
* Removes prefixed tables from the database from crashed tests.
*/
function
simpletest_clean_database
()
{
$tables
=
db_find_tables
(
Database
::
getConnection
()
->
prefixTables
(
'{simpletest}'
)
.
'%'
);
$schema
=
drupal_get_module_schema
(
'simpletest'
);
$tables
=
db_find_tables
(
'test%'
);
$count
=
0
;
foreach
(
array_diff_key
(
$tables
,
$schema
)
as
$table
)
{
//
Strip the prefix and skip tables without digits following "simpletest"
,
//
e.g. {simpletest_test_id
}.
if
(
preg_match
(
'/
simple
test\d+.*/'
,
$table
,
$matches
))
{
foreach
(
$tables
as
$table
)
{
//
Only drop tables which begin wih 'test' followed by digits, for example
,
//
{test12345678node__body
}.
if
(
preg_match
(
'/
^
test\d+.*/'
,
$table
,
$matches
))
{
db_drop_table
(
$matches
[
0
]);
$count
++
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment