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/oembed/postEmbedUrl.php

    r48937 r52010  
    55 */
    66class Tests_Post_Embed_URL extends WP_UnitTestCase {
    7     function test_non_existent_post() {
     7    public function test_non_existent_post() {
    88        $embed_url = get_post_embed_url( 0 );
    99        $this->assertFalse( $embed_url );
    1010    }
    1111
    12     function test_with_pretty_permalinks() {
     12    public function test_with_pretty_permalinks() {
    1313        $this->set_permalink_structure( '/%postname%' );
    1414
     
    2020    }
    2121
    22     function test_with_ugly_permalinks() {
     22    public function test_with_ugly_permalinks() {
    2323        $post_id   = self::factory()->post->create();
    2424        $permalink = get_permalink( $post_id );
     
    3131     * @ticket 34971
    3232     */
    33     function test_static_front_page() {
     33    public function test_static_front_page() {
    3434        $this->set_permalink_structure( '/%postname%/' );
    3535
     
    4949     * @ticket 34971
    5050     */
    51     function test_static_front_page_with_ugly_permalinks() {
     51    public function test_static_front_page_with_ugly_permalinks() {
    5252        $post_id = self::factory()->post->create( array( 'post_type' => 'page' ) );
    5353
     
    6565     * @ticket 34971
    6666     */
    67     function test_page_conflicts_with_embed_slug() {
     67    public function test_page_conflicts_with_embed_slug() {
    6868        $this->set_permalink_structure( '/%postname%/' );
    6969
     
    8787     * @ticket 34971
    8888     */
    89     function test_static_front_page_conflicts_with_embed_slug() {
     89    public function test_static_front_page_conflicts_with_embed_slug() {
    9090        $this->set_permalink_structure( '/%postname%/' );
    9191
Note: See TracChangeset for help on using the changeset viewer.