99use ProxyManager \Factory \LazyLoadingValueHolderFactory ;
1010use ProxyManager \Proxy \LazyLoadingInterface ;
1111use Yiisoft \Definitions \ArrayDefinition ;
12- use Yiisoft \Definitions \LazyDefinitionDecorator ;
12+ use Yiisoft \Definitions \LazyDefinition ;
1313use Yiisoft \Definitions \Tests \Support \EngineInterface ;
1414use Yiisoft \Definitions \Tests \Support \NotFinalClass ;
1515use Yiisoft \Definitions \Tests \Support \Phone ;
@@ -19,31 +19,33 @@ final class LazyDefinitionDecoratorTest extends TestCase
1919{
2020 public function testDecorateFinalClass (): void
2121 {
22- $ container = new SimpleContainer ();
23- $ factory = new LazyLoadingValueHolderFactory ();
22+ $ container = new SimpleContainer ([
23+ LazyLoadingValueHolderFactory::class => new LazyLoadingValueHolderFactory (),
24+ ]);
2425
2526 $ class = Phone::class;
2627
2728 $ definition = ArrayDefinition::fromConfig ([
2829 ArrayDefinition::CLASS_NAME => $ class ,
2930 ]);
30- $ definition = new LazyDefinitionDecorator ( $ factory , $ definition , $ class );
31+ $ definition = new LazyDefinition ( $ definition , $ class );
3132
3233 $ this ->expectException (InvalidProxiedClassException::class);
3334 $ definition ->resolve ($ container );
3435 }
3536
3637 public function testDecorateNotFinalClass (): void
3738 {
38- $ container = new SimpleContainer ();
39- $ factory = new LazyLoadingValueHolderFactory ();
39+ $ container = new SimpleContainer ([
40+ LazyLoadingValueHolderFactory::class => new LazyLoadingValueHolderFactory (),
41+ ]);
4042
4143 $ class = NotFinalClass::class;
4244
4345 $ definition = ArrayDefinition::fromConfig ([
4446 ArrayDefinition::CLASS_NAME => $ class ,
4547 ]);
46- $ definition = new LazyDefinitionDecorator ( $ factory , $ definition , $ class );
48+ $ definition = new LazyDefinition ( $ definition , $ class );
4749
4850 $ phone = $ definition ->resolve ($ container );
4951
@@ -52,15 +54,16 @@ public function testDecorateNotFinalClass(): void
5254
5355 public function testDecorateInterface (): void
5456 {
55- $ container = new SimpleContainer ();
56- $ factory = new LazyLoadingValueHolderFactory ();
57+ $ container = new SimpleContainer ([
58+ LazyLoadingValueHolderFactory::class => new LazyLoadingValueHolderFactory (),
59+ ]);
5760
5861 $ class = EngineInterface::class;
5962
6063 $ definition = ArrayDefinition::fromConfig ([
6164 ArrayDefinition::CLASS_NAME => $ class ,
6265 ]);
63- $ definition = new LazyDefinitionDecorator ( $ factory , $ definition , $ class );
66+ $ definition = new LazyDefinition ( $ definition , $ class );
6467
6568 $ phone = $ definition ->resolve ($ container );
6669
0 commit comments