Deploy Ladill Events / deploy (push) Successful in 25s
Keep logo and cover asset URLs on Events instead of redirecting them to ladl.link, which does not serve uploaded QR storage files. Co-authored-by: Cursor <cursoragent@cursor.com>
46 lines
1.4 KiB
PHP
46 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace Tests\Feature;
|
|
|
|
use App\Http\Middleware\RedirectLegacyQrToLadillLink;
|
|
use App\Support\LadillLink;
|
|
use Illuminate\Http\Request;
|
|
use Tests\TestCase;
|
|
|
|
class LegacyQrRedirectTest extends TestCase
|
|
{
|
|
public function test_event_branding_assets_are_not_redirected_to_ladill_link(): void
|
|
{
|
|
$middleware = new RedirectLegacyQrToLadillLink;
|
|
|
|
foreach (['event-logo', 'event-cover', 'itinerary-cover'] as $suffix) {
|
|
$request = Request::create('/q/demo-event/'.$suffix, 'GET');
|
|
$request->setRouteResolver(function () use ($request) {
|
|
return new class($request)
|
|
{
|
|
public function __construct(private Request $request) {}
|
|
|
|
public function parameter(string $name): ?string
|
|
{
|
|
return $name === 'shortCode' ? 'demo-event' : null;
|
|
}
|
|
};
|
|
});
|
|
|
|
$response = $middleware->handle($request, fn () => response('ok'));
|
|
|
|
$this->assertSame(200, $response->getStatusCode());
|
|
$this->assertSame('ok', $response->getContent());
|
|
}
|
|
}
|
|
|
|
public function test_public_event_pages_still_redirect_to_ladill_link(): void
|
|
{
|
|
config(['link.public_domain' => 'ladl.link']);
|
|
|
|
$response = $this->get('/q/demo-event');
|
|
|
|
$response->assertRedirect(LadillLink::url('demo-event'));
|
|
}
|
|
}
|