wordpress-develop/tests/phpunit/tests/functions/addMagicQuotes.php
Sergey Biryukov 835e9c48a4 Tests: Add missing @covers tags for files in phpunit/tests/functions/.
Props pbearne, jrf.
See #39265.

git-svn-id: https://develop.svn.wordpress.org/trunk@49006 602fd350-edb4-49c9-b593-d223f7449a82
2020-09-19 15:52:03 +00:00

66 lines
1.1 KiB
PHP

<?php
/**
* @group formatting
* @group functions.php
* @covers ::add_magic_quotes
*/
class Tests_Functions_AddMagicQuotes extends WP_UnitTestCase {
/**
* @ticket 48605
*
* @dataProvider data_add_magic_quotes
*
* @param array $test_array Test value.
* @param array $expected Expected return value.
*/
function test_add_magic_quotes( $test_array, $expected ) {
$this->assertSame( $expected, add_magic_quotes( $test_array ) );
}
/**
* Data provider for test_add_magic_quotes.
*
* @return array[] Test parameters {
* @type array $test_array Test value.
* @type array $expected Expected return value.
* }
*/
public function data_add_magic_quotes() {
return array(
array(
array(
'sample string',
52,
true,
false,
null,
"This is a 'string'",
array(
1,
false,
true,
'This is "another" string',
),
),
array(
'sample string',
52,
true,
false,
null,
"This is a \'string\'",
array(
1,
false,
true,
'This is \"another\" string',
),
),
),
);
}
}