Skip to content

Commit

Permalink
[paypal-ec] add support of order confirmation step.
Browse files Browse the repository at this point in the history
  • Loading branch information
makasim committed Oct 20, 2015
1 parent 134a32d commit 570e2c8
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions KlarnaCheckoutGatewayFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,9 @@ protected function populateConfig(ArrayObject $config)
return $klarnaConfig;
};
}

$config['payum.paths'] = array_replace([
'PayumKlarnaCheckout' => __DIR__.'/Resources/views',
], $config['payum.paths'] ?: []);
}
}
24 changes: 24 additions & 0 deletions Tests/KlarnaCheckoutGatewayFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,28 @@ public function shouldThrowIfRequiredOptionsNotPassed()

$factory->create();
}

/**
* @test
*/
public function shouldConfigurePaths()
{
$factory = new KlarnaCheckoutGatewayFactory();

$config = $factory->createConfig();

$this->assertInternalType('array', $config);
$this->assertNotEmpty($config);

$this->assertInternalType('array', $config['payum.paths']);
$this->assertNotEmpty($config['payum.paths']);

$this->assertArrayHasKey('PayumCore', $config['payum.paths']);
$this->assertStringEndsWith('Resources/views', $config['payum.paths']['PayumCore']);
$this->assertTrue(file_exists($config['payum.paths']['PayumCore']));

$this->assertArrayHasKey('PayumKlarnaCheckout', $config['payum.paths']);
$this->assertStringEndsWith('Resources/views', $config['payum.paths']['PayumKlarnaCheckout']);
$this->assertTrue(file_exists($config['payum.paths']['PayumKlarnaCheckout']));
}
}

0 comments on commit 570e2c8

Please sign in to comment.