Skip to content

Commit

Permalink
[Config] Fix stylesSet YAML keys normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
GeLoLabs committed Aug 14, 2014
1 parent d2edc31 commit b9f21fa
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ after_script: bin/coveralls

matrix:
include:
- php: 5.5
env: SYMFONY_VERSION=2.1.*
- php: 5.5
env: SYMFONY_VERSION=2.2.*
- php: 5.5
Expand Down
2 changes: 2 additions & 0 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,12 @@ protected function createStylesNode()
->scalarNode('name')->end()
->scalarNode('element')->end()
->arrayNode('styles')
->normalizeKeys(false)
->useAttributeAsKey('name')
->prototype('scalar')->end()
->end()
->arrayNode('attributes')
->normalizeKeys(false)
->useAttributeAsKey('name')
->prototype('scalar')->end()
->end()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ public function testStylesSets()

$expected = array(
'default' => array(
array('name' => 'Blue Title', 'element' => 'h2', 'styles' => array('color' => 'Blue')),
array('name' => 'CSS Style', 'element' => 'span', 'attributes' => array('class' => 'my_style')),
array('name' => 'Blue Title', 'element' => 'h2', 'styles' => array('text-decoration' => 'underline')),
array('name' => 'CSS Style', 'element' => 'span', 'attributes' => array('data-class' => 'my-style')),
)
);

Expand Down
4 changes: 2 additions & 2 deletions Tests/Fixtures/config/Yaml/styles_sets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ ivory_ck_editor:
-
name: "Blue Title"
element: "h2"
styles: { color: "Blue" }
styles: { text-decoration: "underline" }
-
name: "CSS Style"
element: "span"
attributes: { class: "my_style" }
attributes: { data-class: "my-style" }
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
],
"require": {
"php": ">=5.3.3",
"symfony/framework-bundle": "~2.1",
"symfony/form": "~2.1",
"symfony/framework-bundle": "~2.2",
"symfony/form": "~2.2",
"egeloen/json-builder": "~1.0"
},
"require-dev": {
Expand Down

0 comments on commit b9f21fa

Please sign in to comment.