After #327480: simpletest should not contain DB specific code was fixed, I get 4 failed tests when running System > Module list functionality:

Tables matching "aggregator" found.  Other  system.test  48  EnableDisableCoreTestCase->testEnableDisable()	
Tables matching "aggregator" found.  Other  system.test  59  EnableDisableCoreTestCase->testEnableDisable()	
Tables matching "languages" found.   Other  system.test  97  EnableDisableCoreTestCase->testEnableWithoutDependency()	
Tables matching "locale" found.      Other  system.test  98  EnableDisableCoreTestCase->testEnableWithoutDependency()	

This patch fixes that.

Comments

chx’s picture

Very nice but can you add please then this to simpletest as well?

Edit: I mean, where we call prefixTables in the module.

c960657’s picture

StatusFileSize
new8.61 KB

Even before #327480: simpletest should not contain DB specific code was fixed, Simpletest didn't work too well with $db_prefix != ''. This patch tries to fix that. Previously Simpletest used a table prefix matching ^simpletest\d+, i.e. it did not include the existing $db_prefix. This patch changes that so that if $db_prefix is foo_, the Simpletest tables are named e.g. foo_simpletest123456node_revisions.

With the patch all tests pass with and without a $db_prefix.

catch’s picture

Priority: Normal » Critical
Status: Needs review » Reviewed & tested by the community

This looks good, and it fixes the failing test. RTBC.

dries’s picture

Status: Reviewed & tested by the community » Needs work

Can we rename $reg to $matches? What does $reg stands for?

keith.smith’s picture

Also,

+ // Strip $db_prefix and skip tables without digets following "simpletest",

"digets" should be "digits"

c960657’s picture

Status: Needs work » Needs review
StatusFileSize
new9.05 KB

What does $reg stands for?

Good question. It is a convention I have used for ages without giving it much thought. I have probably picked it up somewhere in my early PHP days, perhaps from a tutorial or something.

Anyway, the variable name is changed and the typo is fixed.

dries’s picture

Status: Needs review » Fixed

Great. Thanks for the quick reroll. Committed to CVS HEAD.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.