Make WordPress Core

Changeset 51628


Ignore:
Timestamp:
08/17/2021 08:01:15 PM (5 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/pomo/po.php

    r51568 r51628  
    55 */
    66class Tests_POMO_PO extends WP_UnitTestCase {
    7         function set_up() {
     7
     8        public static function set_up_before_class() {
     9                parent::set_up_before_class();
     10
     11                require_once ABSPATH . '/wp-includes/pomo/po.php';
     12        }
     13
     14        public function set_up() {
    815                parent::set_up();
    9                 require_once ABSPATH . '/wp-includes/pomo/po.php';
     16
    1017                // Not so random wordpress.pot string -- multiple lines.
    1118                $this->mail    = 'Your new WordPress blog has been successfully set up at:
Note: See TracChangeset for help on using the changeset viewer.