Skip to content

Commit

Permalink
build(includes) update Core PHPUnit suite
Browse files Browse the repository at this point in the history
  • Loading branch information
lucatume committed Dec 7, 2023
1 parent 16a922b commit 4f17043
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions includes/core-phpunit/includes/abstract-testcase.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ abstract class WP_UnitTestCase_Base extends PHPUnit_Adapter_TestCase {
protected $caught_deprecated = array();
protected $expected_doing_it_wrong = array();
protected $caught_doing_it_wrong = array();
private static ?string $calledClass = null;

private static ?string $calledClass = null;

protected static $hooks_saved = array();
protected static $ignore_files;
Expand Down Expand Up @@ -73,7 +74,7 @@ public static function set_up_before_class() {
$class = self::$calledClass ?? get_called_class();

if ( method_exists( $class, 'wpSetUpBeforeClass' ) ) {
call_user_func( array( $class, 'wpSetUpBeforeClass' ), self::factory() );
call_user_func( array( $class, 'wpSetUpBeforeClass' ), static::factory() );
}

self::commit_transaction();
Expand All @@ -83,7 +84,7 @@ public static function set_up_before_class() {
* Runs the routine after all tests have been run.
*/
public static function tear_down_after_class() {
$class = self::$calledClass ?? get_called_class();
$class = self::$calledClass ?? get_called_class();

if ( method_exists( $class, 'wpTearDownAfterClass' ) ) {
call_user_func( array( $class, 'wpTearDownAfterClass' ) );
Expand All @@ -103,7 +104,7 @@ public static function tear_down_after_class() {
public function set_up() {
set_time_limit( 0 );

$this->factory = self::factory();
$this->factory = static::factory();

if ( ! self::$ignore_files ) {
self::$ignore_files = $this->scan_user_uploads();
Expand Down

0 comments on commit 4f17043

Please sign in to comment.