Skip to content

Commit

Permalink
Breaking : Fix exception when building forms (#12)
Browse files Browse the repository at this point in the history
* fix: exception when building form

* fix: update tests twig namespaces

* docs: update changelog
  • Loading branch information
axelveber authored Jul 9, 2021
1 parent 2374181 commit 9126f6d
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Fixed
- Fix exception when building forms #12

## [1.0.1] - 2020-09-23
### Fixed
- Package no longer require `dev` minimum stability.
Expand Down
6 changes: 5 additions & 1 deletion bundle/Resources/config/prepend/ezplatform.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
system:
admin_group:
field_templates:
- template: '@eZColorPicker/admin/content_fields.html.twig'
priority: 1
default:
field_templates:
- template: '@ezdesign/ColorPicker/content_fields.html.twig'
- template: '@eZColorPicker/standard/content_fields.html.twig'
priority: 1
2 changes: 1 addition & 1 deletion bundle/Resources/config/prepend/twig.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
form_themes:
- '@ezdesign/ColorPicker/field_template.html.twig'
- '@eZColorPicker/admin/field_template.html.twig'
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
}
},
"require-dev": {
"matthiasnoback/symfony-dependency-injection-test": "v2.3.*"
"matthiasnoback/symfony-dependency-injection-test": "v2.3.*",
"phpunit/phpunit": "^6.5"
}
}
28 changes: 19 additions & 9 deletions tests/bundle/DependencyInjection/eZColorPickerExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,27 @@ public function testPrependEzpublish()
$actualPrependedConfig = array_merge(...$actualPrependedConfig);

$expectedPrependedConfig = [
'field_templates' => [
[
'template' => '@ezdesign/ColorPicker/content_fields.html.twig',
'priority' => 1,
],
]
'admin_group' => [
'field_templates' => [
[
'template' => '@eZColorPicker/admin/content_fields.html.twig',
'priority' => 1,
]
]
],
'default' => [
'field_templates' => [
[
'template' => '@eZColorPicker/standard/content_fields.html.twig',
'priority' => 1,
],
]
],
];

self::assertSame(
$expectedPrependedConfig,
$actualPrependedConfig['system']['default']
$actualPrependedConfig['system']
);
}

Expand All @@ -59,7 +69,7 @@ public function testPrependTwig()

$expectedPrependedConfig = [
'form_themes' => [
"@ezdesign/ColorPicker/field_template.html.twig"
"@eZColorPicker/admin/field_template.html.twig"
]
];

Expand All @@ -68,4 +78,4 @@ public function testPrependTwig()
$actualPrependedConfig
);
}
}
}

0 comments on commit 9126f6d

Please sign in to comment.