Exemplo n.º 1
0
 /**
  * @test
  *
  * @expectedException \Payum\Core\Exception\InvalidArgumentException
  * @expectedExceptionMessage Storage for given class "stdClass" does not exist.
  */
 public function alwaysThrowOnGetStorageForObject()
 {
     $registry = new DynamicRegistry($this->createStorageMock(), $this->createGatewayFactoryRegistryMock());
     $registry->setBackwardCompatibility(false);
     $registry->getStorage(new \stdClass());
 }
Exemplo n.º 2
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;
 }