1212use Doctrine \ORM \Mapping \NamingStrategy ;
1313use Doctrine \ORM \Mapping \QuoteStrategy ;
1414use Doctrine \Persistence \Mapping \Driver \MappingDriver ;
15+ use DoctrineORMModule \Options \Configuration ;
1516use DoctrineORMModule \Service \ConfigurationFactory ;
1617use DoctrineORMModuleTest \Assets \RepositoryClass ;
1718use Laminas \ServiceManager \Exception \InvalidArgumentException ;
@@ -47,7 +48,7 @@ public function testWillInstantiateConfigWithoutNamingStrategySetting(): void
4748 ],
4849 ];
4950 $ this ->serviceManager ->setService ('config ' , $ config );
50- $ ormConfig = $ this ->factory -> createService ($ this ->serviceManager );
51+ $ ormConfig = ( $ this ->factory ) ($ this ->serviceManager , Configuration::class );
5152 $ this ->assertInstanceOf (NamingStrategy::class, $ ormConfig ->getNamingStrategy ());
5253 }
5354
@@ -64,7 +65,7 @@ public function testWillInstantiateConfigWithNamingStrategyObject(): void
6465 ];
6566 $ this ->serviceManager ->setService ('config ' , $ config );
6667 $ factory = new ConfigurationFactory ('test_default ' );
67- $ ormConfig = $ factory-> createService ($ this ->serviceManager );
68+ $ ormConfig = $ factory ($ this ->serviceManager , Configuration::class );
6869 $ this ->assertSame ($ namingStrategy , $ ormConfig ->getNamingStrategy ());
6970 }
7071
@@ -80,7 +81,7 @@ public function testWillInstantiateConfigWithNamingStrategyReference(): void
8081 ];
8182 $ this ->serviceManager ->setService ('config ' , $ config );
8283 $ this ->serviceManager ->setService ('test_naming_strategy ' , $ namingStrategy );
83- $ ormConfig = $ this ->factory -> createService ($ this ->serviceManager );
84+ $ ormConfig = ( $ this ->factory ) ($ this ->serviceManager , Configuration::class );
8485 $ this ->assertSame ($ namingStrategy , $ ormConfig ->getNamingStrategy ());
8586 }
8687
@@ -95,7 +96,7 @@ public function testWillNotInstantiateConfigWithInvalidNamingStrategyReference()
9596 ];
9697 $ this ->serviceManager ->setService ('config ' , $ config );
9798 $ this ->expectException (InvalidArgumentException::class);
98- $ this ->factory -> createService ($ this ->serviceManager );
99+ ( $ this ->factory ) ($ this ->serviceManager , Configuration::class );
99100 }
100101
101102 public function testWillInstantiateConfigWithQuoteStrategyObject (): void
@@ -111,7 +112,7 @@ public function testWillInstantiateConfigWithQuoteStrategyObject(): void
111112 ];
112113 $ this ->serviceManager ->setService ('config ' , $ config );
113114 $ factory = new ConfigurationFactory ('test_default ' );
114- $ ormConfig = $ factory-> createService ($ this ->serviceManager );
115+ $ ormConfig = $ factory ($ this ->serviceManager , Configuration::class );
115116 $ this ->assertSame ($ quoteStrategy , $ ormConfig ->getQuoteStrategy ());
116117 }
117118
@@ -127,7 +128,7 @@ public function testWillInstantiateConfigWithQuoteStrategyReference(): void
127128 ];
128129 $ this ->serviceManager ->setService ('config ' , $ config );
129130 $ this ->serviceManager ->setService ('test_quote_strategy ' , $ quoteStrategy );
130- $ ormConfig = $ this ->factory -> createService ($ this ->serviceManager );
131+ $ ormConfig = ( $ this ->factory ) ($ this ->serviceManager , Configuration::class );
131132 $ this ->assertSame ($ quoteStrategy , $ ormConfig ->getQuoteStrategy ());
132133 }
133134
@@ -142,7 +143,7 @@ public function testWillNotInstantiateConfigWithInvalidQuoteStrategyReference():
142143 ];
143144 $ this ->serviceManager ->setService ('config ' , $ config );
144145 $ this ->expectException (InvalidArgumentException::class);
145- $ this ->factory -> createService ($ this ->serviceManager );
146+ ( $ this ->factory ) ($ this ->serviceManager , Configuration::class );
146147 }
147148
148149 public function testWillInstantiateConfigWithHydrationCacheSetting (): void
@@ -156,7 +157,7 @@ public function testWillInstantiateConfigWithHydrationCacheSetting(): void
156157 ];
157158 $ this ->serviceManager ->setService ('config ' , $ config );
158159 $ factory = new ConfigurationFactory ('test_default ' );
159- $ ormConfig = $ factory-> createService ($ this ->serviceManager );
160+ $ ormConfig = $ factory ($ this ->serviceManager , Configuration::class );
160161 $ this ->assertInstanceOf (ArrayCache::class, $ ormConfig ->getHydrationCacheImpl ());
161162 }
162163
@@ -176,7 +177,7 @@ public function testCanSetDefaultRepositoryClass(): void
176177 $ this ->serviceManager ->setService ('config ' , $ config );
177178
178179 $ factory = new ConfigurationFactory ('test_default ' );
179- $ ormConfig = $ factory-> createService ($ this ->serviceManager );
180+ $ ormConfig = $ factory ($ this ->serviceManager , Configuration::class );
180181 $ this ->assertInstanceOf (ArrayCache::class, $ ormConfig ->getHydrationCacheImpl ());
181182 }
182183
@@ -191,7 +192,7 @@ public function testAcceptsMetadataFactory(): void
191192 ];
192193 $ this ->serviceManager ->setService ('config ' , $ config );
193194 $ factory = new ConfigurationFactory ('test_default ' );
194- $ ormConfig = $ factory-> createService ($ this ->serviceManager );
195+ $ ormConfig = $ factory ($ this ->serviceManager , Configuration::class );
195196 $ this ->assertEquals ('Factory ' , $ ormConfig ->getClassMetadataFactoryName ());
196197 }
197198
@@ -206,7 +207,7 @@ public function testDefaultMetadatFactory(): void
206207 ];
207208 $ this ->serviceManager ->setService ('config ' , $ config );
208209 $ factory = new ConfigurationFactory ('test_default ' );
209- $ ormConfig = $ factory-> createService ($ this ->serviceManager );
210+ $ ormConfig = $ factory ($ this ->serviceManager , Configuration::class );
210211 $ this ->assertEquals (
211212 ClassMetadataFactory::class,
212213 $ ormConfig ->getClassMetadataFactoryName ()
@@ -225,7 +226,7 @@ public function testWillInstantiateConfigWithoutEntityListenerResolverSetting():
225226
226227 $ this ->serviceManager ->setService ('config ' , $ config );
227228
228- $ ormConfig = $ this ->factory -> createService ($ this ->serviceManager );
229+ $ ormConfig = ( $ this ->factory ) ($ this ->serviceManager , Configuration::class );
229230
230231 $ this ->assertInstanceOf (
231232 EntityListenerResolver::class,
@@ -247,7 +248,7 @@ public function testWillInstantiateConfigWithEntityListenerResolverObject(): voi
247248
248249 $ this ->serviceManager ->setService ('config ' , $ config );
249250
250- $ ormConfig = $ this ->factory -> createService ($ this ->serviceManager );
251+ $ ormConfig = ( $ this ->factory ) ($ this ->serviceManager , Configuration::class );
251252
252253 $ this ->assertSame ($ entityListenerResolver , $ ormConfig ->getEntityListenerResolver ());
253254 }
@@ -267,7 +268,7 @@ public function testWillInstantiateConfigWithEntityListenerResolverReference():
267268 $ this ->serviceManager ->setService ('config ' , $ config );
268269 $ this ->serviceManager ->setService ('test_entity_listener_resolver ' , $ entityListenerResolver );
269270
270- $ ormConfig = $ this ->factory -> createService ($ this ->serviceManager );
271+ $ ormConfig = ( $ this ->factory ) ($ this ->serviceManager , Configuration::class );
271272
272273 $ this ->assertSame ($ entityListenerResolver , $ ormConfig ->getEntityListenerResolver ());
273274 }
@@ -284,7 +285,7 @@ public function testDoNotCreateSecondLevelCacheByDefault(): void
284285
285286 $ this ->serviceManager ->setService ('config ' , $ config );
286287
287- $ ormConfig = $ this ->factory -> createService ($ this ->serviceManager );
288+ $ ormConfig = ( $ this ->factory ) ($ this ->serviceManager , Configuration::class );
288289
289290 $ this ->assertNull ($ ormConfig ->getSecondLevelCacheConfiguration ());
290291 }
@@ -322,7 +323,7 @@ public function testCanInstantiateWithSecondLevelCacheConfig(): void
322323
323324 $ this ->serviceManager ->setService ('config ' , $ config );
324325
325- $ ormConfig = $ this ->factory -> createService ($ this ->serviceManager );
326+ $ ormConfig = ( $ this ->factory ) ($ this ->serviceManager , Configuration::class );
326327 $ secondLevelCache = $ ormConfig ->getSecondLevelCacheConfiguration ();
327328
328329 $ this ->assertInstanceOf (CacheConfiguration::class, $ secondLevelCache );
0 commit comments