/** * @test * * @expectedException \Payum\Core\Exception\InvalidArgumentException * @expectedExceptionMessage Gateway factory "theName" does not exist. */ public function alwaysThrowOnGetGatewayFactory() { $registry = new DynamicRegistry($this->createStorageMock(), $this->createGatewayFactoryRegistryMock()); $registry->setBackwardCompatibility(false); $registry->getGatewayFactory('theName'); }
/** * @test */ public function shouldCallStaticRegistryOnGetGatewayFactory() { $staticRegistryMock = $this->createRegistryMock(); $staticRegistryMock->expects($this->once())->method('getGatewayFactory')->with('theName')->willReturn('theGatewayFactory'); $registry = new DynamicRegistry($this->createStorageMock(), $staticRegistryMock); $this->assertEquals('theGatewayFactory', $registry->getGatewayFactory('theName')); }