Refactor dynamic image export methods to use binary output and improve caching logic

This commit is contained in:
Jeppe Bundgaard
2026-06-09 14:48:46 +02:00
parent 0aad41fd0f
commit e26034dfae
6 changed files with 116 additions and 72 deletions
@@ -56,8 +56,16 @@ namespace {
expect($moduleConfig)->toContain('public selfserve_dynamic_image_size_c $dynamic_image_size;');
expect($route)->toContain('$dynamic_image_size = self::getSelfServeDynamicImageSizeMode();');
expect($route)->toContain("'dynamic_image_size' => \$dynamic_image_size");
expect($route)->toContain('self::buildDynamicImageCacheKey');
expect($route)->toContain("'thumb_position' => \$thumb_position");
expect($route)->toContain("'buttons' => \$buttons");
expect($route)->toContain("'current_step' => \$current_step");
expect($route)->toContain("'only_current_step' => \$only_current_step");
expect($route)->toContain("'vehicle_type' => \$vehicle_type");
expect($route)->toContain("resizeToMaxWidth(self::RELEVANT_DYNAMIC_IMAGE_MAX_WIDTH)");
expect($imageTrait)->toContain('function resizeToMaxWidth(int $maxWidth)');
expect($imageTrait)->toContain('function exportBinary(?string $format = null, int $quality = 90): string');
expect($route)->toContain("\$imageData = \$image->exportBinary('png');");
});
it('accepts ordered dynamic image button tokens including program picker reset start and zero', function (): void {