mirror of
https://github.com/Respect/Validation.git
synced 2026-03-15 14:55:44 +01:00
The standards `CompositeStringifier` from "respect/stringifier" has lots of interesting stringifiers. However, this library is not 100% focused on engineers. Someone could type a string that matches a callable, and then you will overexpose the system. This commit makes sure that callables are not interpreted as callables.
19 lines
440 B
PHP
19 lines
440 B
PHP
<?php
|
|
|
|
/*
|
|
* Copyright (c) Alexandre Gomes Gaigalas <alganet@gmail.com>
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Respect\Validation\Message\StandardStringifier;
|
|
|
|
test('Should return `unknown` when cannot stringify value', function (): void {
|
|
$resource = tmpfile();
|
|
fclose($resource);
|
|
|
|
$stringifier = new StandardStringifier();
|
|
|
|
expect($stringifier->stringify($resource, 0))->toBe('`unknown`');
|
|
});
|