File tree 4 files changed +42
-0
lines changed
src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection
4 files changed +42
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ $ container ->loadFromExtension ('framework ' , array (
4
+ 'messenger ' => array (
5
+ 'middlewares ' => array (
6
+ 'validation ' => array (
7
+ 'enabled ' => false ,
8
+ ),
9
+ ),
10
+ ),
11
+ ));
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" utf-8" ?>
2
+ <container xmlns =" http://symfony.com/schema/dic/services"
3
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4
+ xmlns : framework =" http://symfony.com/schema/dic/symfony"
5
+ xsi : schemaLocation =" http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
6
+ http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
7
+
8
+ <framework : config >
9
+ <framework : messenger >
10
+ <framework : middlewares >
11
+ <framework : validation enabled =" false" />
12
+ </framework : middlewares >
13
+ </framework : messenger >
14
+ </framework : config >
15
+ </container >
Original file line number Diff line number Diff line change
1
+ framework :
2
+ messenger :
3
+ middlewares :
4
+ validation :
5
+ enabled : false
Original file line number Diff line number Diff line change 45
45
use Symfony \Component \Serializer \Normalizer \JsonSerializableNormalizer ;
46
46
use Symfony \Component \Translation \DependencyInjection \TranslatorPass ;
47
47
use Symfony \Component \Validator \DependencyInjection \AddConstraintValidatorsPass ;
48
+ use Symfony \Component \Validator \Validation ;
48
49
use Symfony \Component \Workflow ;
49
50
50
51
abstract class FrameworkExtensionTest extends TestCase
@@ -532,6 +533,16 @@ public function testMessengerDoctrine()
532
533
$ this ->assertEquals ('foobar ' , $ def ->getArgument (1 ));
533
534
}
534
535
536
+ public function testMessengerValidationDisabled ()
537
+ {
538
+ if (!class_exists (Validation::class)) {
539
+ self ::markTestSkipped ('Skipping tests since Validator component is not installed ' );
540
+ }
541
+
542
+ $ container = $ this ->createContainerFromFile ('messenger_validation ' );
543
+ $ this ->assertFalse ($ container ->hasDefinition ('messenger.middleware.validator ' ));
544
+ }
545
+
535
546
public function testTranslator ()
536
547
{
537
548
$ container = $ this ->createContainerFromFile ('full ' );
You can’t perform that action at this time.
0 commit comments