• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress develop tests

WordPress develop tests

WordPress develop tests a2z

  • Home
  • Plugins
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / Tests_Option_UpdateOption::test_autoload_should_not_be_updated_for_existing_option_when_value_is_changed_but_no_value_of_autoload_is_provided() –

You appear to be a bot. Output may be restricted

Description

Usage

Tests_Option_UpdateOption::test_autoload_should_not_be_updated_for_existing_option_when_value_is_changed_but_no_value_of_autoload_is_provided();

Parameters

Returns

void

Source

File name: wordpress-develop-tests/phpunit/tests/option/updateOption.php


Lines:

1 to 21 of 21
  public function test_autoload_should_not_be_updated_for_existing_option_when_value_is_changed_but_no_value_of_autoload_is_provided() {
    global $wpdb;
    add_option( 'foo', 'bar', '', 'yes' );

    // Don't pass a value for `$autoload`.
    $updated = update_option( 'foo', 'bar2' );
    $this->assertTrue( $updated );

    $this->flush_cache();

    // Populate the alloptions cache, which includes autoload=yes options.
    wp_load_alloptions();

    $before = $wpdb->num_queries;
    $value  = get_option( 'foo' );

    // 'foo' should still be autoload=yes, so we should see no additional querios.
    $this->assertSame( $before, $wpdb->num_queries );
    $this->assertSame( $value, 'bar2' );
  }
 

 View on GitHub

Published: 26th November 2019 | Last updated: 20th March 2022

Primary Sidebar

Information

Function name: Tests_Option_UpdateOption::test_autoload_should_not_be_updated_for_existing_option_when_value_is_changed_but_no_value_of_autoload_is_provided
Class ref: Tests_Option_UpdateOption
Plugin ref: WordPress develop tests
Version: 5.9.3
Sourcefile: phpunit/tests/option/updateOption.php
File ref: phpunit/tests/option/updateOption.php
Deprecated?: No
API Letters: A,O,T,U

Footer

WordPress develop tests
WordPress develop tests
WordPress develop tests a2z
WordPress 6.4.1
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  develop.wp-a2z.org
© Copyright WordPress develop tests 2014-2023. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites