Fix ExceptionListener for test env, remove broken CurrentDateDirectoryNamer, update schema
- ExceptionListener now only active in prod (skip dev AND test) - Remove CurrentDateDirectoryNamer from vich_uploader config (class not available) - Add test for test environment skip - Update test DB schema for Event entity columns Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -9,10 +9,6 @@ vich_uploader:
|
||||
uri_prefix: /uploads/events
|
||||
upload_destination: default.storage
|
||||
namer: Vich\UploaderBundle\Naming\SmartUniqueNamer
|
||||
directory_namer:
|
||||
service: Vich\UploaderBundle\Naming\CurrentDateDirectoryNamer
|
||||
options:
|
||||
date_time_format: 'Y/m'
|
||||
|
||||
organizer_logo:
|
||||
uri_prefix: /uploads/logos
|
||||
|
||||
@@ -20,7 +20,7 @@ class ExceptionListener
|
||||
|
||||
public function __invoke(ExceptionEvent $event): void
|
||||
{
|
||||
if ('dev' === $this->kernelEnvironment) {
|
||||
if ('prod' !== $this->kernelEnvironment) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,19 @@ class ExceptionListenerTest extends TestCase
|
||||
self::assertNull($event->getResponse());
|
||||
}
|
||||
|
||||
public function testDoesNothingInTestEnvironment(): void
|
||||
{
|
||||
$twig = $this->createMock(Environment::class);
|
||||
$twig->expects(self::never())->method('render');
|
||||
|
||||
$listener = new ExceptionListener($twig, 'test');
|
||||
$event = $this->createEvent(new \RuntimeException('test'));
|
||||
|
||||
$listener($event);
|
||||
|
||||
self::assertNull($event->getResponse());
|
||||
}
|
||||
|
||||
public function testRenders404Template(): void
|
||||
{
|
||||
$twig = $this->createMock(Environment::class);
|
||||
|
||||
Reference in New Issue
Block a user