Files
XC_VM/tests/Unit/FfmpegPathsTest.php
T
Divarion-D e737025ff8 test: add targeted PHPUnit setup and docs, fix GitHubReleases cache switching
- 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
2026-04-17 22:55:54 +03:00

36 lines
1.1 KiB
PHP

<?php
use PHPUnit\Framework\TestCase;
final class FfmpegPathsTest extends TestCase {
protected function setUp(): void {
$this->resetFfmpegPaths();
}
public function testResolveUsesExpectedBinariesForKnownVersion() {
FfmpegPaths::resolve('8.0');
$this->assertSame(FFMPEG_BIN_80, FfmpegPaths::cpu());
$this->assertSame(FFMPEG_BIN_80, FfmpegPaths::gpu());
$this->assertSame(FFPROBE_BIN_80, FfmpegPaths::probe());
}
public function testResolveFallsBackToLegacyVersion() {
FfmpegPaths::resolve('unknown');
$this->assertSame(FFMPEG_BIN_40, FfmpegPaths::cpu());
$this->assertSame(FFMPEG_BIN_40, FfmpegPaths::gpu());
$this->assertSame(FFPROBE_BIN_40, FfmpegPaths::probe());
}
private function resetFfmpegPaths() {
$reflection = new ReflectionClass('FfmpegPaths');
foreach (array('cpu', 'gpu', 'probe') as $propertyName) {
$property = $reflection->getProperty($propertyName);
$property->setAccessible(true);
$property->setValue(null, null);
}
$resolved = $reflection->getProperty('resolved');
$resolved->setAccessible(true);
$resolved->setValue(null, false);
}
}