diff --git a/src/Sylius/Bundle/CoreBundle/Fixture/PaymentMethodFixture.php b/src/Sylius/Bundle/CoreBundle/Fixture/PaymentMethodFixture.php index d3eb6083e6c..c1d0b80aa34 100644 --- a/src/Sylius/Bundle/CoreBundle/Fixture/PaymentMethodFixture.php +++ b/src/Sylius/Bundle/CoreBundle/Fixture/PaymentMethodFixture.php @@ -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() ; diff --git a/src/Sylius/Bundle/CoreBundle/Tests/Fixture/PaymentMethodFixtureTest.php b/src/Sylius/Bundle/CoreBundle/Tests/Fixture/PaymentMethodFixtureTest.php index f991168328e..ce52d623ee6 100644 --- a/src/Sylius/Bundle/CoreBundle/Tests/Fixture/PaymentMethodFixtureTest.php +++ b/src/Sylius/Bundle/CoreBundle/Tests/Fixture/PaymentMethodFixtureTest.php @@ -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 */