getBasename('.json'); yield [ file_get_contents($fixture->getRealPath()), require __DIR__ . "/fixtures/parsing/{$name}.php", ]; } } /** * Retrieve the fixtures * * @return Generator */ protected static function fixtures(): Generator { foreach (new DirectoryIterator(__DIR__ . '/fixtures/json') as $file) { if (!$file->isDot()) { yield $file; } } } /** * Retrieve the dataset to test single pointers * * @return Generator */ public static function forSinglePointers(): Generator { $singlePointers = require __DIR__ . '/fixtures/pointers/single_pointer.php'; foreach ($singlePointers as $fixture => $pointers) { $json = file_get_contents(__DIR__ . "/fixtures/json/{$fixture}.json"); foreach ($pointers as $pointer => $value) { yield [$json, $pointer, $value]; } } } /** * Retrieve the dataset to test invalid pointers * * @return Generator */ public static function forInvalidPointers(): Generator { yield from ['abc', '/foo~2', '/~', ' ']; } }