Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

Commit

Permalink
remove bundle dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Gyvastis committed Apr 13, 2021
1 parent 445854e commit 11bf76b
Show file tree
Hide file tree
Showing 40 changed files with 49 additions and 59 deletions.
8 changes: 4 additions & 4 deletions composer.json
Expand Up @@ -6,16 +6,16 @@
"license": "MIT",
"autoload": {
"psr-4": {
"PhpArsenal\\": "src"
"PhpArsenal\\SalesforceOutboundMessageBundle\\": "src"
},
"files": [
"src/SalesforceOutboundMessageBundle/functions.php"
"src/functions.php"
]
},
"autoload-dev": {
"files": [
"src/SalesforceOutboundMessageBundle/functions.php",
"vendor/php-arsenal/salesforce-mapper-bundle/src/SalesforceMapperBundle/Annotation/Field.php"
"src/functions.php",
"vendor/php-arsenal/salesforce-mapper-bundle/src/Annotation/Field.php"
],
"psr-4": {
"Tests\\": "tests/"
Expand Down
39 changes: 39 additions & 0 deletions src/DependencyInjection/Configuration.php
@@ -0,0 +1,39 @@
<?php

namespace PhpArsenal\SalesforceOutboundMessageBundle\DependencyInjection;

use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;

class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('arsenal_salesforce_outbound_message');
$treeBuilder
->getRootNode()
->children()
->scalarNode('wsdl_cache')
->defaultValue('WSDL_CACHE_DISK')
->end()
->scalarNode('wsdl_directory')
->isRequired()
->end()
->arrayNode('document_paths')
->arrayPrototype()
->children()
->scalarNode('path')
->isRequired()
->end()
->scalarNode('force_compare')
->defaultFalse()
->end()
->end()
->end()
->end()
->end()
;

return $treeBuilder;
}
}
Expand Up @@ -12,11 +12,12 @@ class SalesforceOutboundMessageExtension extends Extension
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$processedConfiguration =$this->processConfiguration($configuration);

DependencyInjectionBuilder::setupConfigurationParameters(
$container,
$this->processConfiguration($configuration, $configs),
'arsenal_salesforce_outbound_message'
$processedConfiguration,
'arsenal.salesforce_outbound_message'
);

$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
Expand Down

This file was deleted.

File renamed without changes.
14 changes: 3 additions & 11 deletions tests/Unit/DependencyInjection/ConfigurationTest.php
Expand Up @@ -16,30 +16,22 @@ class ConfigurationTest extends TestCase
public function testConfiguration(): void
{
$inputOutput = [
'salesforce_outbound_message' => [
// 'arsenal_salesforce_outbound_message' => [
'wsdl_cache' => 'WSDL_CACHE_NONE',
'wsdl_directory' => '%kernel.project_dir%/Resources/wsdl_documents',
'document_paths' => [
'ObjectToBeRemoved__c' => [
'path' => 'PhpArsenal\SalesforceOutboundMessageBundle\Document\ObjectToBeRemoved',
],
],
]
// ]
];

$configuration = new Configuration();

$configNode = $configuration->getConfigTreeBuilder()->buildTree();
$resultConfig = $configNode->finalize($configNode->normalize($inputOutput));

$this->assertEquals(array_merge_recursive($inputOutput, [
'salesforce_outbound_message' => [
'document_paths' => [
'ObjectToBeRemoved__c' => [
'force_compare' => false,
]
]
]
]), $resultConfig);
$this->assertEquals($inputOutput, $resultConfig);
}
}

0 comments on commit 11bf76b

Please sign in to comment.