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 44
44
use Symfony \Component \Serializer \Normalizer \JsonSerializableNormalizer ;
45
45
use Symfony \Component \Translation \DependencyInjection \TranslatorPass ;
46
46
use Symfony \Component \Validator \DependencyInjection \AddConstraintValidatorsPass ;
47
+ use Symfony \Component \Validator \Validation ;
47
48
use Symfony \Component \Workflow ;
48
49
49
50
abstract class FrameworkExtensionTest extends TestCase
@@ -508,6 +509,16 @@ public function testMessengerDoctrine()
508
509
$ this ->assertEquals ('foobar ' , $ def ->getArgument (1 ));
509
510
}
510
511
512
+ public function testMessengerValidationDisabled ()
513
+ {
514
+ if (!class_exists (Validation::class)) {
515
+ self ::markTestSkipped ('Skipping tests since Validator component is not installed ' );
516
+ }
517
+
518
+ $ container = $ this ->createContainerFromFile ('messenger_validation ' );
519
+ $ this ->assertFalse ($ container ->hasDefinition ('messenger.middleware.validator ' ));
520
+ }
521
+
511
522
public function testTranslator ()
512
523
{
513
524
$ container = $ this ->createContainerFromFile ('full ' );
You can’t perform that action at this time.
0 commit comments