Files
XC_VM/tests/Unit/StreamProcessSubtitleImportTest.php
T
rootandClaude Opus 5 62e7ea55cd fix: three crashes from null values and a missing cache file
- Admin global search: SearchAjaxController asks CategoryService::getAllByType
  (null) for every category type, as the method's docblock and body allow,
  but the cs-fix pass typed the parameter `string`. Any search with results
  threw and returned nothing.
- Movie and episode encoding: startMovie hands movie_subtitles to
  buildSubtitleImport(string), and titles saved without subtitles store NULL.
  The TypeError ended the queue daemon, which stopped encoding the whole
  movie queue.
- Line authentication: every category save or reorder deleted the
  category_map cache, which only the heavy cache pass rebuilds, up to five
  minutes later. Meanwhile getUserInfo passed igbinary_unserialize(false) to
  resolveCategoryIds(array) and player_api, the Ministra portal and probe
  failed for every line. Category saves no longer delete the map (which
  categories a bouquet reaches does not depend on a category's name, type or
  order), and a missing map now means no categories instead of an error.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V2uBUbGApb4A7Rbcoi7dxA
2026-09-17 07:51:18 +00:00

26 lines
843 B
PHP

<?php
use PHPUnit\Framework\TestCase;
use XcVm\Domain\Stream\StreamProcess;
/**
* StreamProcess::buildSubtitleImport() — movies and episodes saved without
* subtitles store movie_subtitles as NULL, and startMovie() hands that value
* over. With a `string` parameter it threw, killing the queue daemon that
* encodes the movie queue.
*/
final class StreamProcessSubtitleImportTest extends TestCase {
private function build(?string $rJson): array {
$rMethod = new ReflectionMethod(StreamProcess::class, 'buildSubtitleImport');
$rMethod->setAccessible(true);
return $rMethod->invoke(null, $rJson, []);
}
public function testNoSubtitlesImportsNothing(): void {
$this->assertSame(['', ''], $this->build(null));
$this->assertSame(['', ''], $this->build(''));
$this->assertSame(['', ''], $this->build('{"files":[]}'));
}
}