Esempio n. 1
0
 /**
  * @test
  */
 public function shouldAllowCreateGateway()
 {
     $factory = new GatewayFactory();
     $gateway = $factory->create(array());
     $this->assertInstanceOf('Payum\\Core\\Gateway', $gateway);
     $this->assertAttributeNotEmpty('apis', $gateway);
     $this->assertAttributeNotEmpty('actions', $gateway);
     $extensions = $this->readAttribute($gateway, 'extensions');
     $this->assertAttributeNotEmpty('extensions', $extensions);
 }
Esempio n. 2
0
 /**
  * @test
  */
 public function shouldAllowPrependExtensions()
 {
     $firstExtension = $this->getMock('Payum\\Core\\Extension\\ExtensionInterface');
     $secondExtension = $this->getMock('Payum\\Core\\Extension\\ExtensionInterface');
     $factory = new GatewayFactory();
     $gateway = $factory->create(array('payum.extension.foo' => $firstExtension, 'payum.extension.bar' => $secondExtension));
     $extensions = $this->readAttribute($this->readAttribute($gateway, 'extensions'), 'extensions');
     $this->assertSame($firstExtension, $extensions[0]);
     $this->assertSame($secondExtension, $extensions[1]);
     $gateway = $factory->create(array('payum.extension.foo' => $firstExtension, 'payum.extension.bar' => $secondExtension, 'payum.prepend_extensions' => array('payum.extension.bar')));
     $extensions = $this->readAttribute($this->readAttribute($gateway, 'extensions'), 'extensions');
     $this->assertSame($secondExtension, $extensions[0]);
     $this->assertSame($firstExtension, $extensions[1]);
 }