File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 66use PhpTypedValues \String \StringPath ;
77use PhpTypedValues \Undefined \Alias \Undefined ;
88
9+ it ('checks valid paths ' , function (): void {
10+ expect (StringPath::fromString ('/etc/passwd ' )->value ())->toBe ('/etc/passwd ' )
11+ ->and (StringPath::fromString ('etc/passwd ' )->value ())->toBe ('etc/passwd ' )
12+ ->and (StringPath::fromString ('etc ' )->value ())->toBe ('etc ' )
13+ ->and (StringPath::fromString ('etc/ ' )->value ())->toBe ('etc/ ' )
14+ ->and (StringPath::fromString ('/etc ' )->value ())->toBe ('/etc ' )
15+ ->and (StringPath::fromString ('etc/passwd/ ' )->value ())->toBe ('etc/passwd/ ' )
16+ ->and (StringPath::fromString ('//etc//passwd// ' )->value ())->toBe ('//etc//passwd// ' )
17+ ->and (StringPath::fromString ('/etc/passwd/ ' )->value ())->toBe ('/etc/passwd/ ' );
18+ });
19+
920it ('accepts valid path, preserves value/toString and casts via __toString ' , function (): void {
1021 $ p1 = new StringPath ('/src/String ' );
1122 $ p2 = new StringPath ('src\String \\' );
You can’t perform that action at this time.
0 commit comments