Files
SealShare/tests/Unit/QrCodeServiceTest.php
Andreas Reinhold / reiniandClaude Opus 5 1352533667 Offer a new share as a QR code and through the share sheet
The share created page gets "Show QR code", a dialog with the link as a
QR code (black on white, full screen on a phone) that downloads as a PNG
drawn in the browser, with a password reminder for protected shares; and
"Share…", which opens the device's share sheet where there is one. Both
carry only the link.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V9NnLxnPp8vaaurb3Z1MFy
2026-09-13 11:46:07 +02:00

22 lines
771 B
PHP

<?php
use App\Services\QrCodeService;
test('it draws a 1024 pixel QR code as inline SVG, black on white', function () {
$svg = (new QrCodeService)->svg('https://share.example.com/s/aBcDeFgHiJkLmNoP');
expect($svg)->toStartWith('<svg ')
->not->toContain('<?xml')
->toContain('width="1024" height="1024"')
->toContain('fill="#ffffff"')
->toContain('fill="#000000"');
});
test('the same contents give the same code, other contents another', function () {
$service = new QrCodeService;
expect($service->svg('https://share.example.com/s/aBcDeFgHiJkLmNoP'))
->toBe($service->svg('https://share.example.com/s/aBcDeFgHiJkLmNoP'))
->not->toBe($service->svg('https://share.example.com/s/zYxWvUtSrQpOnMlK'));
});