File tree 3 files changed +21
-1
lines changed
src/Symfony/Bundle/FrameworkBundle
Tests/DependencyInjection
3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 492
492
493
493
<xsd : complexType name =" lock" >
494
494
<xsd : sequence >
495
- <xsd : element name =" resource" type =" lock_resource" minOccurs =" 1 " maxOccurs =" unbounded" />
495
+ <xsd : element name =" resource" type =" lock_resource" minOccurs =" 0 " maxOccurs =" unbounded" />
496
496
</xsd : sequence >
497
497
<xsd : attribute name =" enabled" type =" xsd:boolean" />
498
498
</xsd : complexType >
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ $ container ->loadFromExtension ('framework ' , [
4
+ 'lock ' => null ,
5
+ ]);
Original file line number Diff line number Diff line change 52
52
use Symfony \Component \HttpFoundation \Session \SessionInterface ;
53
53
use Symfony \Component \HttpKernel \DependencyInjection \LoggerPass ;
54
54
use Symfony \Component \HttpKernel \Fragment \FragmentUriGeneratorInterface ;
55
+ use Symfony \Component \Lock \Store \SemaphoreStore ;
55
56
use Symfony \Component \Messenger \Transport \TransportFactory ;
56
57
use Symfony \Component \Notifier \ChatterInterface ;
57
58
use Symfony \Component \Notifier \TexterInterface ;
@@ -2081,6 +2082,20 @@ public function testIfNotifierTransportsAreKnownByFrameworkExtension()
2081
2082
}
2082
2083
}
2083
2084
2085
+ public function testDefaultLock ()
2086
+ {
2087
+ $ container = $ this ->createContainerFromFile ('lock ' );
2088
+
2089
+ self ::assertTrue ($ container ->hasDefinition ('lock.default.factory ' ));
2090
+ $ storeDef = $ container ->getDefinition ($ container ->getDefinition ('lock.default.factory ' )->getArgument (0 ));
2091
+
2092
+ if (class_exists (SemaphoreStore::class) && SemaphoreStore::isSupported ()) {
2093
+ self ::assertEquals (new Reference ('semaphore ' ), $ storeDef ->getArgument (0 ));
2094
+ } else {
2095
+ self ::assertEquals (new Reference ('flock ' ), $ storeDef ->getArgument (0 ));
2096
+ }
2097
+ }
2098
+
2084
2099
protected function createContainer (array $ data = [])
2085
2100
{
2086
2101
return new ContainerBuilder (new EnvPlaceholderParameterBag (array_merge ([
You can’t perform that action at this time.
0 commit comments