$request =
$this->
createRequest($payload);
$parser =
$this->
createRequestParser();
$wh =
$parser->
parse($request,
$this->
getSecret());
$this->
assertEquals($expected,
$wh);
} public static function getPayloads(): iterable
{ $currentDir = \
dirname((new \
ReflectionClass(static::
class))->
getFileName());
foreach (new \
RecursiveIteratorIterator(new \
RecursiveDirectoryIterator($currentDir.'/Fixtures', \RecursiveDirectoryIterator::SKIP_DOTS
)) as $file) { $filename =
str_replace($currentDir.'/Fixtures/', '',
$file->
getPathname());
if (static::
getFixtureExtension() !==
pathinfo($filename, \PATHINFO_EXTENSION
)) { continue;
} yield $filename =>
[ file_get_contents($file),
include(str_replace('.'.
static::
getFixtureExtension(), '.php',
$file->
getPathname())),
];
} } abstract protected function createRequestParser(): RequestParserInterface;