mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
tests: fixes testing running in php 7.3
This commit is contained in:
@ -10,12 +10,15 @@ $run = function (string $target, $decorated = false) {
|
|||||||
return $decorated ? $process->getOutput() : preg_replace('#\\x1b[[][^A-Za-z]*[A-Za-z]#', '', $process->getOutput());
|
return $decorated ? $process->getOutput() : preg_replace('#\\x1b[[][^A-Za-z]*[A-Za-z]#', '', $process->getOutput());
|
||||||
};
|
};
|
||||||
|
|
||||||
$testsPath = dirname(__DIR__);
|
$snapshot = function ($name) {
|
||||||
$snapshot = fn (string $name) => file_get_contents(implode(DIRECTORY_SEPARATOR, [
|
$testsPath = dirname(__DIR__);
|
||||||
$testsPath,
|
|
||||||
'.snapshots',
|
return file_get_contents(implode(DIRECTORY_SEPARATOR, [
|
||||||
"$name.txt",
|
$testsPath,
|
||||||
]));
|
'.snapshots',
|
||||||
|
"$name.txt",
|
||||||
|
]));
|
||||||
|
};
|
||||||
|
|
||||||
test('allows to run a single test', function () use ($run, $snapshot) {
|
test('allows to run a single test', function () use ($run, $snapshot) {
|
||||||
assertStringContainsString(
|
assertStringContainsString(
|
||||||
|
|||||||
Reference in New Issue
Block a user