numTextures)->toBe(2); expect($textureX->offsets)->toBe([$offset0, $offset1]); expect($textureX->textures)->toHaveCount(2); $first = $textureX->textures[0]; expect($first->name)->toBe('BRICK1'); expect($first->masked)->toBeFalse(); expect($first->width)->toBe(64); expect($first->height)->toBe(128); expect($first->patches)->toHaveCount(1); expect($first->patches[0]->originX)->toBe(8); expect($first->patches[0]->originY)->toBe(-4); expect($first->patches[0]->patch)->toBe(3); $second = $textureX->firstTextureByName('metal2'); expect($second)->not->toBeNull(); expect($second->masked)->toBeTrue(); expect($second->patches)->toHaveCount(2); expect($second->patches[1]->originX)->toBe(12); expect($second->patches[1]->originY)->toBe(4); expect($second->patches[1]->patch)->toBe(8); }); test('throws on invalid texture offset', function (): void { $data = pack('V', 1) . pack('V', 999); expect(fn () => TextureXParser::parseBytes($data))->toThrow(RuntimeException::class); });