From 16b448416bcfc7ea9757ade3bfc9603a6b886a11 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 17 Aug 2021 20:01:15 +0000 Subject: [PATCH] Tests: Move loading the `PO` class to `set_up_before_class()`. This ensures that the class is loaded once before the first test of the test case class is run, and `require_once()` is not unnecessarily called for each test method individually. Follow-up to [1106/tests]. See #53363. git-svn-id: https://develop.svn.wordpress.org/trunk@51628 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/pomo/po.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/tests/pomo/po.php b/tests/phpunit/tests/pomo/po.php index c79b37033f..9a37b4dd4e 100644 --- a/tests/phpunit/tests/pomo/po.php +++ b/tests/phpunit/tests/pomo/po.php @@ -4,9 +4,16 @@ * @group pomo */ class Tests_POMO_PO extends WP_UnitTestCase { - function set_up() { - parent::set_up(); + + public static function set_up_before_class() { + parent::set_up_before_class(); + require_once ABSPATH . '/wp-includes/pomo/po.php'; + } + + public function set_up() { + parent::set_up(); + // Not so random wordpress.pot string -- multiple lines. $this->mail = 'Your new WordPress blog has been successfully set up at: