Make WordPress Core

Changeset 53494


Ignore:
Timestamp:
06/13/2022 03:24:11 PM (22 months ago)
Author:
SergeyBiryukov
Message:

Tests: Rename classes in phpunit/tests/option/ per the naming conventions.

https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968], [50969], [51491], [51492], [51493], [51623], [51639], [51646], [51650], [51651], [51860], [52264], [52265], [53489].

See #55652.

Location:
trunk/tests/phpunit/tests/option
Files:
4 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/option/multisite.php

    r52010 r53494  
    1010     * @group multisite
    1111     */
    12     class Tests_Multisite_Option extends WP_UnitTestCase {
     12    class Tests_Option_Multisite extends WP_UnitTestCase {
    1313
    1414        public function test_from_same_site() {
  • trunk/tests/phpunit/tests/option/option.php

    r52010 r53494  
    225225    }
    226226
     227    /**
     228     * Options should be autoloaded unless they were added with "no" or `false`.
     229     *
     230     * @ticket 31119
     231     * @dataProvider data_option_autoloading
     232     */
     233    public function test_option_autoloading( $name, $autoload_value, $expected ) {
     234        global $wpdb;
     235        $added = add_option( $name, 'Autoload test', '', $autoload_value );
     236        $this->assertTrue( $added );
     237
     238        $actual = $wpdb->get_row( $wpdb->prepare( "SELECT autoload FROM $wpdb->options WHERE option_name = %s LIMIT 1", $name ) );
     239        $this->assertSame( $expected, $actual->autoload );
     240    }
     241
     242    /**
     243     * Data provider.
     244     *
     245     * @return array
     246     */
    227247    public function data_option_autoloading() {
    228248        return array(
     
    236256        );
    237257    }
    238     /**
    239      * Options should be autoloaded unless they were added with "no" or `false`.
    240      *
    241      * @ticket 31119
    242      * @dataProvider data_option_autoloading
    243      */
    244     public function test_option_autoloading( $name, $autoload_value, $expected ) {
    245         global $wpdb;
    246         $added = add_option( $name, 'Autoload test', '', $autoload_value );
    247         $this->assertTrue( $added );
    248 
    249         $actual = $wpdb->get_row( $wpdb->prepare( "SELECT autoload FROM $wpdb->options WHERE option_name = %s LIMIT 1", $name ) );
    250         $this->assertSame( $expected, $actual->autoload );
    251     }
    252258}
  • trunk/tests/phpunit/tests/option/sanitizeOption.php

    r53493 r53494  
    44 * @group option
    55 */
    6 class Tests_Sanitize_Option extends WP_UnitTestCase {
     6class Tests_Option_SanitizeOption extends WP_UnitTestCase {
    77
    88    /**
  • trunk/tests/phpunit/tests/option/themeMods.php

    r52010 r53494  
    44 * @group option
    55 */
    6 class Tests_Option_Theme_Mods extends WP_UnitTestCase {
     6class Tests_Option_ThemeMods extends WP_UnitTestCase {
    77
    88    public function test_theme_mod_default() {
  • trunk/tests/phpunit/tests/option/userSettings.php

    r52010 r53494  
    11<?php
    22/**
    3  * @group 123456
     3 * @group option
     4 * @group user
    45 */
    5 class Tests_User_Settings extends WP_UnitTestCase {
     6class Tests_Option_UserSettings extends WP_UnitTestCase {
    67    protected $user_id;
    78
  • trunk/tests/phpunit/tests/option/wpLoadAlloptions.php

    r53493 r53494  
    55 * @group option
    66 */
    7 class Tests_Option_WP_Load_Alloptions extends WP_UnitTestCase {
     7class Tests_Option_wpLoadAlloptions extends WP_UnitTestCase {
    88    protected $alloptions = null;
    99
Note: See TracChangeset for help on using the changeset viewer.