Make WordPress Core


Ignore:
Timestamp:
11/04/2021 03:22:47 PM (3 years ago)
Author:
hellofromTonya
Message:

Coding Standards: Add visibility to methods in tests/phpunit/tests/.

Adds a public visibility to test fixtures, tests, data providers, and callbacks methods.

Adds a private visibility to helper methods within test classes.

Renames callbacks and helpers that previously started with a _ prefix. Why? For consistency and to leverage using the method visibility. Further naming standardizations is beyond the scope of this commit.

Props costdev, jrf, hellofromTonya.
Fixes #54177.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/date/mysql2date.php

    r51568 r52010  
    88class Tests_Date_mysql2date extends WP_UnitTestCase {
    99
    10     function tear_down() {
     10    public function tear_down() {
    1111        // phpcs:ignore WordPress.DateTime.RestrictedFunctions.timezone_change_date_default_timezone_set
    1212        date_default_timezone_set( 'UTC' );
     
    1818     * @ticket 28310
    1919     */
    20     function test_mysql2date_returns_false_with_no_date() {
     20    public function test_mysql2date_returns_false_with_no_date() {
    2121        $this->assertFalse( mysql2date( 'F j, Y H:i:s', '' ) );
    2222    }
     
    2525     * @ticket 28310
    2626     */
    27     function test_mysql2date_returns_gmt_or_unix_timestamp() {
     27    public function test_mysql2date_returns_gmt_or_unix_timestamp() {
    2828        $this->assertSame( 441013392, mysql2date( 'G', '1983-12-23 07:43:12' ) );
    2929        $this->assertSame( 441013392, mysql2date( 'U', '1983-12-23 07:43:12' ) );
     
    3333     * @ticket 28992
    3434     */
    35     function test_mysql2date_should_format_time() {
     35    public function test_mysql2date_should_format_time() {
    3636        $timezone = 'Europe/Kiev';
    3737        update_option( 'timezone_string', $timezone );
     
    4747     * @ticket 28992
    4848     */
    49     function test_mysql2date_should_format_time_with_changed_time_zone() {
     49    public function test_mysql2date_should_format_time_with_changed_time_zone() {
    5050        $timezone = 'Europe/Kiev';
    5151        // phpcs:ignore WordPress.DateTime.RestrictedFunctions.timezone_change_date_default_timezone_set
     
    6363     * @ticket 28992
    6464     */
    65     function test_mysql2date_should_return_wp_timestamp() {
     65    public function test_mysql2date_should_return_wp_timestamp() {
    6666        $timezone = 'Europe/Kiev';
    6767        update_option( 'timezone_string', $timezone );
     
    7777     * @ticket 28992
    7878     */
    79     function test_mysql2date_should_return_unix_timestamp_for_gmt_time() {
     79    public function test_mysql2date_should_return_unix_timestamp_for_gmt_time() {
    8080        $timezone = 'Europe/Kiev';
    8181        update_option( 'timezone_string', $timezone );
Note: See TracChangeset for help on using the changeset viewer.