TheWebShop / bootstrap-shortcodes

Wordpress plugin to add shortcodes for Twitter Bootstrap 3.0
36 stars 15 forks source link

Tests #33

Closed No3x closed 9 years ago

No3x commented 10 years ago

Since the increasing amount of bugs that were not spotted while development and even not by a tester before pushing a new plugin version to the wordpress plugin directory I suggest to introduce unit tests with phpunit and QUnit.

For example we can execute tests for the latest version and even the master-branch of wp. If something breaks we will know it before the wp update rollout.

I already spend some time in this field but still clearing questions about it. Currently I don't have much time but I'm sure to present a testing suite for continuous test execution while development and after a commit (thanks to travis-ci integration) until I have some time.

I don't know what you think about it? The project can't be small enough to do tests in my opinion. I really like the plugin but if a user finds a bug it's really annoying for him. We don't really want this imho.

Maybe there are some suggestions, info, opinions?

Sinetheta commented 10 years ago

That sounds like a sweet idea. I'd be avoiding it because I figured that unit testing would probably involve significant refactoring, and I don't want to imagine what setting up integration tests to run on some type of CI would require.

It's an area I'm very interested in though, so I'd be happy to invest time just for the learning, with a more stable plugin as a nice side-benefit. However, I have a feeling that the field of "properly testing wordpress plugins" might not be the most well trodden :wink:

No3x commented 10 years ago

All right! I will keep going on my own. I found this really helpful to get an overview about testing in wp: http://de.slideshare.net/ptahdunbar/automated-testing-in-wordpress-really

I have already set up an environment at https://github.com/No3x/wordpress-ci-test basically adapted from https://github.com/wp-cli/sample-plugin. Important is the bin/install-wp-tests.sh that is executed by travis via /travis.yml and executes the tests in /tests/. I agree, integration tests would be hard but possible with selenium.