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
22 lines
771 B
PHP
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'));
|
|
});
|