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:
parent
c25e06e46b
commit
a39f8ad5d1
35
tests/json/sanitizer_test.php
Normal file
35
tests/json/sanitizer_test.php
Normal 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));
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user