Automated testing of WordPress involves running test cases where manual intervention is not required to run each one.
The purpose of this plugin is twofold:
Nothing as a plugin. You have to invoke the tests using PHPUnit.
From v4.9.1 we provide a modified version of the phpunit.xml file so that you can attempt to run the WordPress core tests in situ.
Testsuites The primary directory is different. You run the tests from the plugin directory, Instead of being called tests/phpunit/tests the directory is phpunit/tests
We expect PHP 7.2 - 7.4 so there's no need for the exclude sections
<testsuites>
<!-- Default test suite to run all tests -->
<testsuite>
<directory suffix=".php">tests/phpunit/tests</directory>
<exclude>tests/phpunit/tests/actions/closures.php</exclude>
<exclude>tests/phpunit/tests/image/editor.php</exclude>
<exclude>tests/phpunit/tests/image/editorGd.php</exclude>
<exclude>tests/phpunit/tests/image/editorImagick.php</exclude>
<exclude>tests/phpunit/tests/oembed/headers.php</exclude>
<file phpVersion="5.3.0">tests/phpunit/tests/actions/closures.php</file>
<file phpVersion="5.3.0">tests/phpunit/tests/image/editor.php</file>
<file phpVersion="5.3.0">tests/phpunit/tests/image/editorGd.php</file>
<file phpVersion="5.3.0">tests/phpunit/tests/image/editorImagick.php</file>
<file phpVersion="5.3.0">tests/phpunit/tests/oembed/headers.php</file>
</testsuite>
Groups - the exclusion list is the same.
<groups>
<exclude>
<group>ajax</group>
<group>ms-files</group>
<group>ms-required</group>
<group>external-http</group>
</exclude>
</groups>
Logging - There's no logging section.
<logging>
<log type="junit" target="tests/phpunit/build/logs/junit.xml" logIncompleteSkipped="false"/>
</logging>
We control it from the command line.
Listeners - There's no listener section
<listeners>
<listener class="SpeedTrapListener" file="tests/phpunit/includes/speed-trap-listener.php">
<arguments>
<array>
<element key="slowThreshold">
<integer>150</integer>
</element>
</array>
</arguments>
</listener>
</listeners>
Filter - There's no filter section - since we don't do code coverage
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>
PHP const - same as for core
If you activate the plugin then nothing is expected to happen since it doesn't contain any code.
If you run PHPUnit then quite a lot might happen.
And if you had happened to configure your database the same as your live site then you could destroy your live site. But probably not completely!
I'm sure you could try to do this but I can't see why you'd want to.
Use this plugin in combination with oik-batch
From WordPress 5.9 and above the only version supported is PHPUnit 9.
In the same way that WP-a2z.org helps you to develop WordPress code this provides you with a dynamic reference of current tests. See develop.wp-a2z.org
Yes. oik-plugins are PHPUnit tested using in situ testing. See How to run PHPUnit tests for WordPress plugins in situ
Method: March/April 2022
As for August 2020
Plus, update the main plugin file ( wordpress-develop-gtests.php ) to set the new version number.
Method: August 2020
Install the WordPress Git mirror. See commands below.
Change directory to a clone of the GitHub repository bobbingwide/wordpress-develop-tests
Remove the phpunit and qunit directories
Copy files from the tests folder, phpunit and qunit
update the readme.txt file
Commit changes, including any deletions
Push to GitHub
Pull into the WP-a2z websites plugin directory
Build the dynamic API reference for the latest level
cd \github\wordpress
git clone https://github.com/WordPress/wordpress-develop
cd \svn\wordpress-develop
svn co https://develop.svn.wordpress.org/tags/5.3
remaining steps as August 2016
Method: Oct 2019
Extract https://develop.svn.wordpress.org/tags/5.2.3 to c:\svn\wordpress-develop\5.2.3
cd \svn\wordpress-develop
svn co https://develop.svn.wordpress.org/tags/5.2.3
remaining steps as August 2016
Method: Dec 2018
Extract https://develop.svn.wordpress.org/tags/5.0 to c:\svn\wordpress-develop\5.0
cd \svn\wordpress-develop
svn co https://develop.svn.wordpress.org/tags/5.0
remaining steps as August 2016
Method: May 2018
Extract http://develop.svn.wordpress.org/tags/4.9.6 to c:\svn\wordpress-develop\4.9.6
cd \svn\wordpress-develop
svn co http://develop.svn.wordpress.org/tags/4.9.6
remaining steps as August 2016
Method: November 2017
Extract http://develop.svn.wordpress.org/tags/4.9 to c:\svn\wordpress-develop\4.9
cd \svn\wordpress-develop
svn co http://develop.svn.wordpress.org/tags/4.9
remaining steps as August 2016
Method: August 2017
Extract http://develop.svn.wordpress.org/tags/4.8.1 to c:\svn\wordpress-develop\4.8.1
remaining steps as August 2016
Method: June 2017
Extract http://develop.svn.wordpress.org/trunk to C:\svn\wordpress-develop
remaining steps as August 2016
Method: March 2017
Extract http://develop.svn.wordpress.org/tags/4.7.3 to c:\svn\wordpress-develop\4.7.3
remaining steps as August 2016
Method: December 2016
Extract http://develop.svn.wordpress.org/branch/4.7 to C:\svn\wordpress-develop\4.7
remaining steps as August 2016
Method: August 2016
This is the latest process used to build the API reference.
Extract http://develop.svn.wordpress.org/trunk to C:\svn\wordpress-develop
Change directory to a clone of the GitHub repository bobbingwide/wordpress-develop-tests
Remove the phpunit and qunit directories
Copy files from the tests folder, phpunit and qunit
update the readme.txt file
Commit changes, including any deletions
Push to GitHub
Pull into the WP-a2z websites plugin directory
Build the dynamic API reference for the latest level
Original method: Nov 2014
To get WP-A2z to work locally I simply created a symbolic link from the latest SVN version to a plugin directory.
cd wp-content/plugins mklink /J wordpress-develop-tests svn\wordpress-develop\tests
Built from https://github.com/WordPress/wordpress-develop ( on 2022/03/20 ) Now requires PHPUnit 9.
Built from https://github.com/WordPress/wordpress-develop ( on 2020/08/30 )
Built from https://develop.svn.wordpress.org/tags/5.3 ( on 2019/11/26 )
Now requires PHPUnit 8. Built from https://develop.svn.wordpress.org/tags/5.2.3 ( on 2019/10/09 )
Built from https://develop.svn.wordpress.org/tags/5.0 ( on 2018/12/07 )
Built from http://develop.svn.wordpress.org/tags/4.9.6 ( on 2018/05/27 )
Built from http://develop.svn.wordpress.org/tags/4.9 ( on 2017/11/16 )
Built from http://develop.svn.wordpress.org/tags/4.8.3 ( on 2017/08/04 )
Built from http://develop.svn.wordpress.org/trunk ( on 2017/06/02 )
Built from http://develop.svn.wordpress.org/tags/4.7.3 (on 2017/03/12 )
Built from http://develop.svn.wordpress.org/branch/4.7 (on 2016/12/07 )
Built from an SVN extract of trunk taken 2016/08/19
Built from an SVN extract of trunk taken 2016/07/07
Built from an update performed on 20 Nov 2014
Extract the latest version of WordPress developer from
https://develop.svn.wordpress.org/trunk/
This will also extract the latest version of the source.
Read about: