trim
symfony/var-dumper
Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Strip whitespace (or other characters) from the beginning and end of a string
trim
(
string $string
,
string $characters
=
" \n\r\t\v\x00"
):
string
$descriptor
->
describe
(
$output
, new
Data
([[
123
]]),
$context
+ [
'timestamp'
=>
1544804268.3668
],
1
);
$this
->
assertStringMatchesFormat
(
trim
(
$expectedOutput
),
str_replace
(
\PHP_EOL
,
"\n"
,
trim
(
$output
->
fetch
())));
}
public function
provideContext
()
Tests/Command/Descriptor/CliDescriptorTest.php
$descriptor
->
describe
(
$output
, new
Data
([[
123
]]),
$context
+ [
'timestamp'
=>
1544804268.3668
],
1
);
$this
->
assertStringMatchesFormat
(
trim
(
$expectedOutput
),
trim
(
preg_replace
(
'@<style>.*</style><script>.*</script>@s'
,
''
,
$output
->
fetch
())));
}
public function
provideContext
()
Tests/Command/Descriptor/HtmlDescriptorTest.php