[wp-hackers] Running the WordPress test suite with PHPUnit
peter.westwood at ftwr.co.uk
Wed Jun 23 06:44:15 UTC 2010
I assume the output to XML would just mean changing the PHPUnitPrinter
class we use.
I'll try and have a look tonight.
On 23 Jun 2010, at 07:15, David Morris <dvmorris at gmail.com> wrote:
> Has anyone ever gotten the wordpress test suite (
> svn.automattic.com/wordpress-tests/) to run using PHPUnit from the
> line, instead of running "php wp-test.php"?
> I would like to integrate testing into a continuous integration
> and I am having trouble translating wp-test.php into a PHPUnit
> file. I would like to run the Wordpress test suite like this:
> phpunit --bootstrap bootstrap.php --log-junit phpunit.xml
> I created a bootstrap.php file that is heavily based on wp-test.php,
> and I
> when I run it, I get this error:
> Fatal error: Call to undefined method stdClass::set_prefix() in
> C:\wamp\www\wordpress\trunk\src\wp-settings.php on line 286
> Line 286 of wp-settings.php is this:
> $prefix = $wpdb->set_prefix($table_prefix); // set up global tables
> It appears that $wpdb is not being defined properly by this point in
> execution of the bootstrap.php file, but when I run "php wp-
> test.php", which
> is almost the same execution steps, it works. It leads me to believe
> there is some issue with the way PHPUnit bootstrap files handle all of
> WordPress' global variables, like $wpdb.
> Another alternative for me would be to get the "php wp-test.php" to
> spit out
> junit style xml files, which would probably be sufficient for me
> right now.
> I have been unable to get it to work so far.
> Anyways, someone on the IRC channel suggested I ask the wp-hackers
> list. Any
> help would be greatly appreciated.
> Dave Morris
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers