File: Helpers.formatValue%28%29.phpt

package info (click to toggle)
php-nette-schema 1.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 324 kB
  • sloc: php: 925; makefile: 8
file content (21 lines) | stat: -rw-r--r-- 728 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php

declare(strict_types=1);

use Nette\Schema\Helpers;
use Tester\Assert;

require __DIR__ . '/../bootstrap.php';


Assert::same('null', Helpers::formatValue(null));
Assert::same('1', Helpers::formatValue(1));
Assert::same('1.0', Helpers::formatValue(1.0));
Assert::same('true', Helpers::formatValue(true));
Assert::same('false', Helpers::formatValue(false));
Assert::same("'hello'", Helpers::formatValue('hello'));
Assert::same("'nettenettene...'", Helpers::formatValue(str_repeat('nette', 100)));
Assert::same('array', Helpers::formatValue([1, 2]));
Assert::same('object stdClass', Helpers::formatValue(new stdClass));
Assert::same('dynamic', Helpers::formatValue(new class implements Nette\Schema\DynamicParameter {
}));