Make the GitHub-release GeoIP updates cohesive and testable, and keep the
GitHubReleases class a generic release client.
- GitHubReleases: drop the domain-specific getGeolite()/getIspDatabase()/
getAsnCatalog() and the private releaseAsset() — they hard-coded the
maxmind paths and GeoIP filenames, which don't belong in a generic
GitHub-releases client. Add the generic assetUrl($version, $asset)
primitive; domain code now composes its own specs around it. Also drop a
stale usage example that referenced the removed getGeolite().
- New XcVm\Core\GeoIP\GeoLiteReleaseUpdater owns the release-asset sync:
builds the GeoLite2-City/Country and GeoIP2-ISP specs (url via assetUrl,
md5 via getAssetHash, local maxmind path), downloads them through ONE
path, and records the version into maxmind/version.json. This unifies
GeoIP2-ISP with GeoLite2 — the ISP now gets the same dir self-heal,
checksum-tolerant "always save" behaviour, status lines and chmod 0750
(was 0640) instead of the leaner fetchReleaseFile() it used before.
- MaxMindCronJob is now a thin orchestrator (updateGeoLite/updateIsp);
AsnCatalogSync builds its own blocked_asns spec via assetUrl/getAssetHash.
- Tests: GeoLiteReleaseUpdaterTest (specs/paths/version, error paths) via a
mocked repo + protected download/record seams; GitHubReleasesTest covers
assetUrl().
Three unit tests were failing against correct production code:
- FfmpegPathsTest errored on an undefined BIN_PATH constant. The test
bootstrap defined FFMPEG_BIN_* but not BIN_PATH, so FfmpegPaths::binary()
faulted before it could fall back. Define BIN_PATH to a fixture-less path
so version lookups miss and the FFMPEG_BIN_40 fallback is exercised.
- GitHubReleasesTest expected the old 'unstable' channel name; the channel
was renamed to 'beta' ('unstable' kept as a legacy alias). Update the
cache-switch test to expect 'beta' (and assert the alias normalizes), and
make the reject-invalid test use a genuinely unknown channel ('nightly').
Full suite now green (461 passing).
- add PHPUnit bootstrap and config under tests/
- add focused unit tests for GitHubReleases, InputValidator and FfmpegPaths
- fix GitHubReleases cache file handling when switching update channel
- document PHPUnit PHAR usage and debug run commands in RU/EN docs
- document SFTP sync for tests/ and contributor test workflow
- remove broad smoke coverage approach in favor of per-file tests