Options, Meta APIs: Delete leftover unit tests.

This is a followup to [56946] to commit the deletion of a leftover PHP Unit file.

See #22192.


git-svn-id: https://develop.svn.wordpress.org/trunk@56947 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Joe McGill 2023-10-16 20:39:19 +00:00
parent ccb9ab4834
commit 36019306ff

View File

@ -1,71 +0,0 @@
<?php
/**
* Tests for _is_equal_database_value().
*
* @group option
*
* @covers ::_is_equal_database_value
*/
class Tests_Option_IsEqualDatabaseValue extends WP_UnitTestCase {
/**
* @ticket 22192
*
* @dataProvider data_is_equal_database_value
*
* @param mixed $old_value The old value to compare.
* @param mixed $new_value The new value to compare.
* @param bool $expected The expected result.
*/
public function test_is_equal_database_value( $old_value, $new_value, $expected ) {
$this->assertSame( $expected, _is_equal_database_value( $old_value, $new_value ) );
}
/**
* Data provider.
*
* @return array
*/
public function data_is_equal_database_value() {
return array(
// Equal values.
array( '123', '123', true ),
// Not equal values.
array( '123', '456', false ),
// Truthy.
array( 1, '1', true ),
array( 1.0, '1', true ),
array( '1', '1', true ),
array( true, '1', true ),
array( '1.0', '1', false ),
array( ' ', '1', false ),
array( array( '0' ), '1', false ),
array( new stdClass(), '1', false ),
array( 'Howdy, admin!', '1', false ),
// False-ish values and empty strings.
array( 0, '0', true ),
array( 0.0, '0', true ),
array( '0', '0', true ),
array( '', '0', false ),
array( false, '0', false ),
array( null, '0', false ),
array( array(), '0', false ),
// Object values.
array( (object) array( 'foo' => 'bar' ), (object) array( 'foo' => 'bar' ), true ),
array( (object) array( 'foo' => 'bar' ), (object) array( 'foo' => 'baz' ), false ),
array( (object) array( 'foo' => 'bar' ), serialize( (object) array( 'foo' => 'bar' ) ), false ),
array( serialize( (object) array( 'foo' => 'bar' ) ), (object) array( 'foo' => 'bar' ), false ),
array( serialize( (object) array( 'foo' => 'bar' ) ), (object) array( 'foo' => 'baz' ), false ),
// Serialized values.
array( array( 'foo' => 'bar' ), serialize( array( 'foo' => 'bar' ) ), false ),
array( array( 'foo' => 'bar' ), serialize( array( 'foo' => 'baz' ) ), false ),
array( serialize( (object) array( 'foo' => 'bar' ) ), serialize( (object) array( 'foo' => 'bar' ) ), true ),
array( serialize( (object) array( 'foo' => 'bar' ) ), serialize( (object) array( 'foo' => 'baz' ) ), false ),
);
}
}