Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No phpunit as a dependency? #26

Open
dingo-d opened this issue Feb 15, 2019 · 2 comments
Open

No phpunit as a dependency? #26

dingo-d opened this issue Feb 15, 2019 · 2 comments

Comments

@dingo-d
Copy link

dingo-d commented Feb 15, 2019

I am a bit puzzled at the setup of this suite.

First what exactly is the prefix that your plugin uses in the database?

The installation recognized I have tests directory (since I'm on VVV), but then it symlinked the plugin to the tests directory and I got

ln: /Users/infinum-denis/vagrant-local/www/wordpress-develop/src/wp-content/plugins/my-plugin: No such file or directory

Because my plugin is located in a directory where I am building it (not the test one).

Also, how come phpunit isn't set as a dependency? Because I can see it's not installed in the vendor folder, and I am getting

zsh: command not found: phpunit

Thanks!

EDIT:

Once I installed phpunt (6.5) and ran vendor/bin/phpunit I get error on the require_once in the bootstrap.php because the path of the plugin is wrong (test assumes it's in the test folder, and it's not).

Is the workaround for this to just put it in the test folder or?

@JDGrimes
Copy link
Owner

Hi @dingo-d , sorry for the delayed reply.

First what exactly is the prefix that your plugin uses in the database?

I can see now that this isn't clear. It is just asking if your plugin uses a particular prefix for the table names/option names/meta keys/etc. that it stores in the DB. This will be used when generating the un/install test, to check that there isn't anything left in the DB with that prefix after the plugin is uninstalled.

The installation recognized I have tests directory (since I'm on VVV), but then it symlinked the plugin to the tests directory and I got

ln: /Users/infinum-denis/vagrant-local/www/wordpress-develop/src/wp-content/plugins/my-plugin: No such file or directory

Because my plugin is located in a directory where I am building it (not the test one).

You should be able to develop the plugin in any directory, that's why it is attempting to just symlink it for you. Yes, you can just copy/move/symlink it manually as a workaround. But I think that the problem is just that VVV changed the path in recent versions. WPPPB needs to add publich_html in there for the latest VVV.

Also, how come phpunit isn't set as a dependency?

I've just always installed PHPUnit globally, and so I didn't add it as a dependency, just assuming others would have PHPUnit installed globally as well. That's probably not best practice though?

@dingo-d
Copy link
Author

dingo-d commented Feb 24, 2019

Thanks for the answer, makes things a bit clearer 🙂

I try to limit globally installed packages, just to avoid any possible conflicts (phpcs and editors have a tendency to do that 😄).

I'll try to play with your test suite a bit more, I was trying out different tools for testing a plugin in WordPress environment so this was one of the options 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants