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
This commit is contained in:
Sergey Biryukov
2021-08-17 20:01:15 +00:00
parent 6d574d7cab
commit 16b448416b

View File

@@ -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: