Reputation: 2302
I'm new to using PHPStorm along with PHPUnit, and the wordpress-develop package.
My projects rely on WooCommerce a lot.
Is it possible to add it as a dependency to the project?
At the moment I get this result:
And have the following setup:
Any help appreciated.
Upvotes: 0
Views: 920
Reputation: 2302
Got it working
What I did was use git to clone the woocommerce project
git clone https://github.com/woocommerce/woocommerce/ temp
Then I copied the tests folder and put it inside my project. Then I kept making edits until it worked with my existing code.
Here is what my project looks like now:
I have a copy of the normal woocommerce project in my includes. The one without the tests, the one you can download from the WordPress plugin repository.
I copied the WooCommerce tests into the project, see folder wc_tests.
Here is what the tests/bootstrap.php file looks like
Note the last line that requires the wc_tests/bootstrap.php file.
I only made one change to the wc_tests file, I changed the plugin directory.
$this->plugin_dir = dirname( $this->tests_dir ) . '/includes/woocommerce';
Combined with a line of code out of screen, it makes the WC available for the project
require_once $this->plugin_dir . '/woocommerce.php';
I'm probably doing some of this wrong, but it works.
Any further questions, tips or advice appreciated.
Upvotes: 3