diff --git a/src/SonataAdminBundle.php b/src/SonataAdminBundle.php index 548b32da48..1f09afb721 100644 --- a/src/SonataAdminBundle.php +++ b/src/SonataAdminBundle.php @@ -14,6 +14,7 @@ namespace Sonata\AdminBundle; use Mopa\Bundle\BootstrapBundle\Form\Type\TabType; +use Sonata\AdminBundle\DependencyInjection\Compiler\AddAuditReadersCompilerPass; use Sonata\AdminBundle\DependencyInjection\Compiler\AddDependencyCallsCompilerPass; use Sonata\AdminBundle\DependencyInjection\Compiler\AddFilterTypeCompilerPass; use Sonata\AdminBundle\DependencyInjection\Compiler\AdminMakerCompilerPass; @@ -59,6 +60,7 @@ public function build(ContainerBuilder $container) $container->addCompilerPass(new ObjectAclManipulatorCompilerPass()); $container->addCompilerPass(new TwigStringExtensionCompilerPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, 1); $container->addCompilerPass(new AdminMakerCompilerPass()); + $container->addCompilerPass(new AddAuditReadersCompilerPass()); $this->registerFormMapping(); } diff --git a/tests/SonataAdminBundleTest.php b/tests/SonataAdminBundleTest.php index 9adb355562..acf80c9463 100644 --- a/tests/SonataAdminBundleTest.php +++ b/tests/SonataAdminBundleTest.php @@ -14,6 +14,7 @@ namespace Sonata\AdminBundle\Tests; use PHPUnit\Framework\TestCase; +use Sonata\AdminBundle\DependencyInjection\Compiler\AddAuditReadersCompilerPass; use Sonata\AdminBundle\DependencyInjection\Compiler\AddDependencyCallsCompilerPass; use Sonata\AdminBundle\DependencyInjection\Compiler\AddFilterTypeCompilerPass; use Sonata\AdminBundle\DependencyInjection\Compiler\AdminMakerCompilerPass; @@ -35,7 +36,7 @@ public function testBuild(): void { $containerBuilder = $this->createMock(ContainerBuilder::class); - $containerBuilder->expects($this->exactly(9)) + $containerBuilder->expects($this->exactly(10)) ->method('addCompilerPass') ->withConsecutive( [new AddDependencyCallsCompilerPass()], @@ -47,6 +48,7 @@ public function testBuild(): void [new ObjectAclManipulatorCompilerPass()], [new TwigStringExtensionCompilerPass()], [new AdminMakerCompilerPass()], + [new AddAuditReadersCompilerPass()], ) ;