Add logo upload to admin organizer edit page
Admin can now view the current logo and upload a new one via the organizer edit form. Uses VichUploader with the existing organizer_logo mapping. Adds test with fixture image. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -509,6 +509,42 @@ class AdminControllerTest extends WebTestCase
|
||||
self::assertSame(0.5, $orga->getCommissionRate());
|
||||
}
|
||||
|
||||
public function testEditOrganizerWithLogo(): void
|
||||
{
|
||||
$client = static::createClient();
|
||||
$em = static::getContainer()->get(EntityManagerInterface::class);
|
||||
$admin = $this->createUser(['ROLE_ROOT']);
|
||||
$orga = $this->createOrganizer($em);
|
||||
$orga->setIsApproved(true);
|
||||
$orga->setOffer('basic');
|
||||
$orga->setCommissionRate(3.0);
|
||||
$em->flush();
|
||||
|
||||
$logo = new \Symfony\Component\HttpFoundation\File\UploadedFile(
|
||||
__DIR__.'/../fixtures/logo.png',
|
||||
'logo.png',
|
||||
'image/png',
|
||||
null,
|
||||
true,
|
||||
);
|
||||
|
||||
$client->loginUser($admin);
|
||||
$client->request('POST', '/admin/organisateur/'.$orga->getId().'/modifier', [
|
||||
'first_name' => $orga->getFirstName(),
|
||||
'last_name' => $orga->getLastName(),
|
||||
'email' => $orga->getEmail(),
|
||||
'company_name' => $orga->getCompanyName(),
|
||||
'siret' => $orga->getSiret(),
|
||||
'offer' => 'basic',
|
||||
'commission_rate' => '3',
|
||||
], ['logo' => $logo]);
|
||||
|
||||
self::assertResponseRedirects('/admin/organisateurs?tab=approved');
|
||||
|
||||
$em->refresh($orga);
|
||||
self::assertNotNull($orga->getLogoName());
|
||||
}
|
||||
|
||||
public function testEditOrganizerRedirectsIfNotApproved(): void
|
||||
{
|
||||
$client = static::createClient();
|
||||
|
||||
BIN
tests/fixtures/logo.png
vendored
Normal file
BIN
tests/fixtures/logo.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 79 B |
Reference in New Issue
Block a user