When I first developed the oik-batch logic it only loaded a subset of WordPress and made a lot of use of functionality in oik.
Over time, for quite a few batch processes, I realised I needed a full WordPress installation.
So, I developed oik-wp.php to do just that; a command line interface to load WordPress and then load (and run) your batch routine.
While oik-wp.php has had to solve similar problems to those encountered by WP-cli, my solution has taken a slightly different direction.
Recently, with WordPress 4.6 released, I decided it was time to implement PHPUnit testing of my plugins and themes.
I read a number of blogs and looked at existing test suites and decided that I actually wanted to be able to write unit tests that can be run in situ.
So in #9, I prototyped a solution which I believe can be used by WordPress plugins and themes alike.
Theoretically all you need is:
PHPUnit in order to run your tests
oik-wp.php to load an existing WordPress environment
The trouble is, I think that oik-wp is dependent on functionality in oik and/or oik-bwtrace.
So it's not yet ready for general release.
Requirement
Remove dependency on oik and/or oik-bwtrace so that oik-wp.php can be used in PHPUnit testing of WordPress plugins and themes in situ.
Proposed solution
Use the same solution developed in oik-bwtrace to make oik-wp.php operate stand alone.
i.e. Deliver the required shared library files as part of oik-batch.
Note: oik-batch already delivers some shared libraries,so this shouldn't be too problematical.
While we're at it
extract common logic from oik-batch.php and oik-wp.php into a shared library file ( libs/oik-cli.php )
remove any code which is now unnecessary. e.g. dependency checking logic.
develop a test that'll work when the routines coexist peacefully.
Don't forget other things to do later
Some of the main routines delivered in oik-batch are totally dependent on oik and other oik plugins.
Over time these routines should be migrated to the most appropriate plugin.
Background waffle
When I first developed the oik-batch logic it only loaded a subset of WordPress and made a lot of use of functionality in oik.
Over time, for quite a few batch processes, I realised I needed a full WordPress installation. So, I developed oik-wp.php to do just that; a command line interface to load WordPress and then load (and run) your batch routine.
While oik-wp.php has had to solve similar problems to those encountered by WP-cli, my solution has taken a slightly different direction.
Recently, with WordPress 4.6 released, I decided it was time to implement PHPUnit testing of my plugins and themes.
I read a number of blogs and looked at existing test suites and decided that I actually wanted to be able to write unit tests that can be run in situ.
So in #9, I prototyped a solution which I believe can be used by WordPress plugins and themes alike. Theoretically all you need is:
The trouble is, I think that oik-wp is dependent on functionality in oik and/or oik-bwtrace. So it's not yet ready for general release.
Requirement
Remove dependency on oik and/or oik-bwtrace so that oik-wp.php can be used in PHPUnit testing of WordPress plugins and themes in situ.
Proposed solution
Use the same solution developed in oik-bwtrace to make oik-wp.php operate stand alone. i.e. Deliver the required shared library files as part of oik-batch. Note: oik-batch already delivers some shared libraries,so this shouldn't be too problematical.
While we're at it
Don't forget other things to do later
Some of the main routines delivered in oik-batch are totally dependent on oik and other oik plugins. Over time these routines should be migrated to the most appropriate plugin.