예제 #1
0
 /**
  * SingletonProvider constructor.
  * @param ClassProviderInterface $provider
  */
 public function __construct(ClassProviderInterface $provider)
 {
     parent::__construct($provider);
     $this->provider = $provider;
 }
예제 #2
0
 public function testSingletonProvider()
 {
     $injector = new Injector(null);
     /** @var ClassProvider $provider */
     $provider = ClassProvider::init(Engine::class);
     $singletonProvider = new SingletonProvider($provider);
     $this->assertSame($singletonProvider->get($injector), $singletonProvider->get($injector));
 }