Skip to content

Make BerlinDB easy to be unit tested with WordPress test suite #104

@engahmeds3ed

Description

@engahmeds3ed

As we know that WP test suite will create any not core tables as temporary tables.

So try this MySQL snippet

CREATE TEMPORARY TABLE wp_test_credits(
    customerNumber INT PRIMARY KEY,
    creditLimit DEC(10,2)
);

this is what exactly WP unit tests framework does.

Then here
https://github.com/berlindb/core/blob/master/table.php#L335

You are trying to run the following mysql query

SHOW TABLES LIKE '%wp_tesssst_credits%';

and this show tables isn't working with temporary tables so the exists method will return false forever in tests, which affects some other methods.

I think if you used the following query

SHOW CREATE TABLE wp_tesssst_credits;

this should work with all tables (temp or normal)

If you agree on the idea, I can open PR for it to validate.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions