1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-03-14 12:40:13 +01:00
php-phpbb/tests/json/sanitizer_test.php
2021-01-26 22:24:06 +01:00

36 lines
762 B
PHP

<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
use phpbb\json\sanitizer;
class phpbb_json_sanitizer_test extends phpbb_test_case
{
public function data_decode()
{
return [
[false, []],
['', []],
['{ "name": "phpbb/phpbb-style-prosilver"}', ['name' => 'phpbb/phpbb-style-prosilver']],
['{ "name":[[ "phpbb/phpbb-style-prosilver"}', []],
];
}
/**
* @dataProvider data_decode
*/
public function test_decode_data($input, $output)
{
$this->assertEquals($output, sanitizer::decode($input));
}
}