1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-03-14 04:30:29 +01:00

[ticket/10824] Add basic test for json sanitizer

PHPBB3-10824
This commit is contained in:
Marc Alexander 2020-01-20 20:36:40 +01:00
parent c25e06e46b
commit a39f8ad5d1
No known key found for this signature in database
GPG Key ID: 50E0D2423696F995

View File

@ -0,0 +1,35 @@
<?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));
}
}