[wp-trac] [WordPress Trac] #17749: Faster and phpunit runner-compatible unit tests

WordPress Trac wp-trac at lists.automattic.com
Tue Oct 18 09:58:49 UTC 2011


#17749: Faster and phpunit runner-compatible unit tests
------------------------------+-------------------------
 Reporter:  nbachiyski        |       Owner:  nbachiyski
     Type:  feature request   |      Status:  reopened
 Priority:  normal            |   Milestone:  3.3
Component:  Unit Tests        |     Version:
 Severity:  normal            |  Resolution:
 Keywords:  has-patch commit  |
------------------------------+-------------------------

Comment (by mrtorrent):

 I think it's silly and detrimental to WordPress to try to extend the life
 of PHP4-based plugins, but I don't really care, so if you want to keep
 $PHP_SELF in, by all means go for it. You'd just need to change line 89
 back:

 {{{
 $_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace( '/(\?.*)?$/', '',
 $_SERVER["REQUEST_URI"] );
 }}}

 The important thing is to get the rest of the patch committed, because it
 makes a big difference: globalising these variables properly means that
 not only can WordPress be run in PHPUnit tests, but also that the API can
 be loaded and used by external applications to integrate with WordPress.
 Surely that's a hell of a win?

 I've written [https://github.com/kayue/WordpressBundle/ an integration
 with Symfony 2's authentication layer], for example, but it can't work if
 WordPress just assumes that it is in the global scope and bombs out
 otherwise.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17749#comment:25>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list