Code Monkey home page Code Monkey logo

Comments (11)

lucatume avatar lucatume commented on June 3, 2024

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.

LRP-sgravel avatar LRP-sgravel commented on June 3, 2024

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.

lucatume avatar lucatume commented on June 3, 2024

Ok, you are using the same database for both modules. Any databes WPLoader uses should be used for WPLoader alone.

from wp-browser.

LRP-sgravel avatar LRP-sgravel commented on June 3, 2024

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.

LRP-sgravel avatar LRP-sgravel commented on June 3, 2024

Why does it only occur with Cest tests???

from wp-browser.

lucatume avatar lucatume commented on June 3, 2024

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.

LRP-sgravel avatar LRP-sgravel commented on June 3, 2024

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.

lucatume avatar lucatume commented on June 3, 2024

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.

LRP-sgravel avatar LRP-sgravel commented on June 3, 2024

I'll read a bit more on the codeception framework along the way

from wp-browser.

lucatume avatar lucatume commented on June 3, 2024

This could probably help you: #32

Closing.

from wp-browser.

lucatume avatar lucatume commented on June 3, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.