WPBrowser test cases refresh

A much needed test case code refresh.

Going with the flow

The core team working on WordPress and its many contributors are slowly extending the test use and coverage of the project and the PhpUnit based tools supplying the testing power are evolving as well.
The wp-browser module for Codeception wraps those test cases and functions to run the WP Loader module and it made sense to catch up on the latest addition.
In version 1.7.7 I had merged a pull request to make the test case included in the WP Loader module extend the Codeception\TestCase\Test class: the reason for it was to harness both the power of the core test cases and those of the Codeception provided base test class.
I did not like the solution, although a working one, as it was creating confusion using the same name to define two different classes.

Additions

The next version of wp-browser packs five new test classes that replicate this behaviour in the same way but eliminating that name collision:

  • WPAJaxTestCase extending the Codeception\TestCase\Test and a copy of the WP_Ajax_UnitTestCase
  • WPCanonicalTestCase extending the Codeception\TestCase\Test and a copy of the WP_Canonical_UnitTestCase
  • WPRestApiTestCase extending the Codeception\TestCase\Test and a copy of the WP_Test_REST_TestCase
  • WPTestCase extending the Codeception\TestCase\Test and a copy of the WP_UnitTestCase
  • WPXMLRPTestCase extending the Codeception\TestCase\Test and a copy of the WP_XMLRPC_UnitTestCase

The wpcept generate method will expand to generate an extension of each of these new classes ready to use.

Next

Some more testing for the code merge and and release.