After much trial and error. I've managed to get the automatic testing setup and running. I'm running a test on a plugin that has no code. It's just the plugin header. Just to make sure everything is working with the phpunit tests.

It's on a brand new multipress install and there is no data besides the default data that comes with a fresh WordPress install.

The problem I'm having is even though there's nothing that should cause a failed test, but I'm getting a bunch of fails. The notes on the fails all seem to have the same problem.

The test are looking for database tables that don't exists. The test are looking for the tables "wptests_65_terms" and "wptests_65_posts". Should I just manually create these tables?

That doesn't really makes sense though, because from what I understand the test drops all the tables during the test.

  • I'm getting these errors as well, so I think maybe it is actually a bug in WordPress. I'll keep working on it and let you know what I find. – J.D. Jun 11 '14 at 19:41
  • I still haven't found the exact cause of this problem, but I suspect it is caused by a test failing that calls switch_to_blog(). Because this (supposed) test is failing, restore_current_blog() doesn't get called further down in the test function, like it normally would. The result is that WordPress is remaining in switched mode for the rest of the tests. But the blog that it is switched to no longer exists, thus the database errors. – J.D. Jun 11 '14 at 21:47
  • In the mean time. I just switch to a standalone WP install, and I found errors in that too. One of them has a ticket on it. It seems like the development of the test isn't very fast. The best solution I've come up with is to just comment out the problems tests. I haven't tried it with a multipress install yet. – gilgimech Jun 12 '14 at 19:46
  • Note also that this won't be a problem when running any tests you write for your plugin, as the core tests won't run when you are just running your plugin's tests. It is only a problem when you want to check if WP core's tests all pass with your plugin active (as you are doing now). – J.D. Jun 12 '14 at 19:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.