mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-04 14:47:02 +00:00
Unit Tests: WP_UnitTest_Generator_Sequence needs a static incrementer - otherwise, it assumes every test class is a reset, which it no longer is (it is now static).
While we're at it, remove unnecessary `tearDown()` code. See #30017, #33968. git-svn-id: https://develop.svn.wordpress.org/trunk@35244 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -401,11 +401,17 @@ abstract class WP_UnitTest_Factory_For_Thing {
|
||||
}
|
||||
|
||||
class WP_UnitTest_Generator_Sequence {
|
||||
var $next;
|
||||
var $template_string;
|
||||
static $incr = -1;
|
||||
public $next;
|
||||
public $template_string;
|
||||
|
||||
function __construct( $template_string = '%s', $start = 1 ) {
|
||||
$this->next = $start;
|
||||
function __construct( $template_string = '%s', $start = null ) {
|
||||
if ( $start ) {
|
||||
$this->next = $start;
|
||||
} else {
|
||||
self::$incr++;
|
||||
$this->next = self::$incr;
|
||||
}
|
||||
$this->template_string = $template_string;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user