Skip to content

Commit

Permalink
[Core][Fixture] Make possible to pass custom array as gateway config
Browse files Browse the repository at this point in the history
  • Loading branch information
Zales0123 committed Mar 24, 2017
1 parent 0d15f50 commit 3574ddb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Expand Up @@ -38,7 +38,7 @@ protected function configureResourceNode(ArrayNodeDefinition $resourceNode)
->scalarNode('description')->cannotBeEmpty()->end()
->scalarNode('gatewayName')->cannotBeEmpty()->end()
->scalarNode('gatewayFactory')->cannotBeEmpty()->end()
->arrayNode('gatewayConfig')->cannotBeEmpty()->end()
->arrayNode('gatewayConfig')->prototype('variable')->end()->end()
->arrayNode('channels')->prototype('scalar')->end()->end()
->booleanNode('enabled')->end()
;
Expand Down
Expand Up @@ -72,6 +72,15 @@ public function payment_method_gateway_configuration_is_optional()
$this->assertConfigurationIsValid([['custom' => [['gatewayConfig' => []]]]], 'custom.*.gatewayConfig');
}

/**
* @test
*/
public function payment_method_gateway_configuration_must_by_array()
{
$this->assertConfigurationIsValid([['custom' => [['gatewayConfig' => ['username' => 'USERNAME']]]]], 'custom.*.gatewayConfig');
$this->assertConfigurationIsInvalid([['custom' => [['gatewayConfig' => 'USERNAME']]]], 'Invalid type for path "payment_method.custom.0.gatewayConfig". Expected array, but got string');
}

/**
* @test
*/
Expand Down

0 comments on commit 3574ddb

Please sign in to comment.