Ejemplo n.º 1
0
 /**
  * @param string $gateway
  * @return KVDutil_Gateway
  */
 public function getGateway($gateway)
 {
     if (!array_key_exists($gateway, $this->gateways)) {
         $this->gateways[$gateway] = $this->factory->createGateway($gateway);
     }
     return $this->gateways[$gateway];
 }
Ejemplo n.º 2
0
 public function testGatewayInjection()
 {
     $config = array('KVDutil_GatewayTestGateway' => array('url' => 'http://test.vioe.be/gateway', 'username' => 'TESTUSER', 'pwd' => 'TESTPWD', 'factory' => array('class' => 'KVDutil_GatewayTestGatewayFactory', 'method' => 'create')));
     $gatewayFactory = new KVDutil_GatewayFactory($config);
     $gateway = $gatewayFactory->createGateway('KVDutil_GatewayTestGateway');
     $this->assertNotNull($gateway);
     $this->assertInstanceOf('KVDutil_Gateway', $gateway);
 }