file_put_contents($fixture . '/docs/logo.svg', 'broken')); $copy('docs/logo.svg'); $mustFail(fn() => unlink($fixture . '/docs/public_offer.pdf')); $copy('docs/public_offer.pdf'); $mustFail(function () use ($fixture, $manifest): void { unset($manifest['files']['docs/logo-alt.svg']); file_put_contents($fixture . '/release/assets.json', json_encode($manifest)); }); $copy('release/assets.json'); $mustFail(function () use ($fixture, $manifest): void { $body = 'WBE70'; file_put_contents($fixture . '/docs/logo.svg', $body); $manifest['files']['docs/logo.svg']['sha256'] = hash('sha256', $body); file_put_contents($fixture . '/release/assets.json', json_encode($manifest)); }); } finally { $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($fixture, FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST); foreach ($iterator as $item) $item->isDir() ? rmdir($item->getPathname()) : unlink($item->getPathname()); rmdir($fixture); } echo "OK: текущие ресурсы, повреждение/удаление/подмена manifest и состав поставки\n";