Make WordPress Core


Ignore:
Timestamp:
10/07/2022 01:02:07 AM (2 years ago)
Author:
desrosj
Message:

Tests: Replace some occurrences of assertEquals() with assertSame().

This ensures that not only the return values match the expected results, but also that their type is the same.

Props costdev, desrosj.
See #55654.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/customize/manager.php

    r54088 r54402  
    25342534        $this->assertSame( $default_value, $setting->post_value( $default_value ) );
    25352535
    2536         $post_value = '42';
    2537         $this->manager->set_post_value( 'numeric', $post_value );
    2538         $this->assertEquals( $post_value, $this->manager->post_value( $setting, $default_value ) );
    2539         $this->assertEquals( $post_value, $setting->post_value( $default_value ) );
     2536        $post_value = 42;
     2537        $this->manager->set_post_value( 'numeric', (string) $post_value );
     2538        $this->assertSame( $post_value, $this->manager->post_value( $setting, $default_value ) );
     2539        $this->assertSame( $post_value, $setting->post_value( $default_value ) );
    25402540    }
    25412541
Note: See TracChangeset for help on using the changeset viewer.