Comments (11)
The WPLoader module will work on the database installing WordPress and destroying it in the process.
The WPDB module you are using with the populate
and cleanup
parameters set to true
.
What's happening is that one of the two modules will not find the db tables it's looking for.
WPLoader is not built on top of PHPUnit: it's a module taking care of loading WordPress the same way the tests provided by the core team do.
Could you post the suites config files?
from wp-browser.
What I meant is that the WP core tests are based on PHPUnit, bad wording sorry...
I am aware if issues between WPDb and WPLoader but in my case, I am not using both modules in the same suite along with Cest tests. Everything works fine with both modules when using the Test format however, like I do in unit & acceptance tests.
My suite config files are empty except for enabling the modules that you can see in the outputs above.
from wp-browser.
Ok, you are using the same database for both modules. Any databes WPLoader uses should be used for WPLoader alone.
from wp-browser.
Haaa I see. Is there a way to have access to the WP codebase/functions without using WPLoader. I'm using it only to have access to functions but I rather load a preset DB for my tests.
from wp-browser.
Why does it only occur with Cest tests???
from wp-browser.
Why does it only occur with Cest tests???
That might be due to the timing test run. The order is relevant.
Haaa I see. Is there a way to have access to the WP codebase/functions without using WPLoader. I'm using it only to have access to functions but I rather load a preset DB for my tests.
No, WPLoader will walk the same path as the core suite and require a db connection and the rather destructive approach.
What you can do is bootstrap a wp instance including the wp-load.php
file. Just know that's exactly how WPLoader began.
from wp-browser.
I might do just that and create a PR
A new module that integrates the changes from the closed PR would fit well in this scenario.
from wp-browser.
You are more than welcome to do it, just keep contexts separated: e.g. a PR to add a test case method should not also contain a new Codeception Module
from wp-browser.
I'll read a bit more on the codeception framework along the way
from wp-browser.
This could probably help you: #32
Closing.
from wp-browser.
An update on this: I've added the WPBootstrapper module, might have a look at that and see how it helps; it's a first version though so anything missing just open an issue and label it "enhancement".
from wp-browser.
Related Issues (20)
- [BUG] @testdox annotation not working for test descriptions HOT 3
- [BUG] Default integration test suite fails with Class "lucatume\WPBrowser\Process\SerializableThrowable" not found error HOT 1
- [BUG] ChromeDriver binary "\vendor\bin\chromedriver" does not exist on Windows HOT 2
- [BUG] Invalid database name on Windows when using SQLite HOT 2
- [BUG] Git Hub Pages are Down? HOT 1
- [BUG] "Could not find a WordPress installation" error when initialising a plugin HOT 1
- [BUG] `amEditingUserWithId()` method missing from v4 HOT 1
- [BUG] Ajax tests fail HOT 2
- [BUG] Tests fail when being run from phpstorm HOT 3
- https://wpbrowser.wptestkit.dev/ not working HOT 1
- [FEATURE REQUEST] Add (grab|see)TransientInDatabase methods to WPDb
- [BUG] v4 doesn't like database names with periods in them HOT 1
- [DOC REQUEST] Test examples HOT 4
- [BUG] Can't access WP built-in functions even when using WPLoader HOT 14
- [BUG] Empty < Invalid database name: > when trying to add WPLoader HOT 2
- [BUG] v4 uses `__wakeup`, which many plugins have overridden with an error. HOT 3
- [BUG] WPLoader doesn't load wordpress installation HOT 11
- [DOC REQUEST] Setup issues HOT 4
- [BUG] Warnings while running tests HOT 1
- [SETUP ISSUE] failed activation, invalid Chrome binary HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wp-browser.