Пример #1
0
 protected function buildRegistry(array $gateways = [], array $storages = [], array $gatewayFactories = [])
 {
     $fallbackRegistry = new SimpleRegistry($gateways, $storages, $gatewayFactories);
     $fallbackRegistry->setAddStorageExtensions(false);
     if ($this->gatewayConfigStorage) {
         $fallbackRegistry = new ComSalesPayumRegistryDynamic_registry($this->gatewayConfigStorage, $fallbackRegistry);
     }
     if ($this->mainRegistry) {
         $registry = new FallbackRegistry($this->mainRegistry, $fallbackRegistry);
     } else {
         $registry = $fallbackRegistry;
     }
     return $registry;
 }
Пример #2
0
 /**
  * @test
  */
 public function shouldNotInitializeStorageExtensionsIfAddStorageExtensionsSetFalse()
 {
     $storageOneMock = $this->getMock(StorageInterface::class);
     $storageTwoMock = $this->getMock(StorageInterface::class);
     $storageThreeMock = $this->getMock(StorageInterface::class);
     $gatewayFooMock = $this->getMock(Gateway::class);
     $gatewayFooMock->expects($this->never())->method('addExtension');
     $gatewayBarMock = $this->getMock(Gateway::class);
     $gatewayBarMock->expects($this->never())->method('addExtension');
     $registry = new SimpleRegistry(array('foo' => $gatewayFooMock, 'bar' => $gatewayBarMock), array('fooClass' => $storageOneMock, 'barClass' => $storageTwoMock, 'ololClass' => $storageThreeMock));
     $registry->setAddStorageExtensions(false);
     $registry->getGateway('foo');
     $registry->getGateway('bar');
 }
Пример #3
0
 /**
  * @param array $gateways
  * @param array $storages
  * @param array $gatewayFactories
  *
  * @return RegistryInterface
  */
 protected function buildRegistry(array $gateways = [], array $storages = [], array $gatewayFactories = [])
 {
     $registry = new SimpleRegistry($gateways, $storages, $gatewayFactories);
     $registry->setAddStorageExtensions(false);
     if ($this->gatewayConfigStorage) {
         $dynamicRegistry = new DynamicRegistry($this->gatewayConfigStorage, $registry);
         $dynamicRegistry->setBackwardCompatibility(false);
         $registry = new FallbackRegistry($dynamicRegistry, $registry);
     }
     if ($this->mainRegistry) {
         $registry = new FallbackRegistry($this->mainRegistry, $registry);
     }
     return $registry;
 }