Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-gribanov committed Feb 7, 2020
1 parent e795442 commit 2cd2ae7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
3 changes: 2 additions & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ private function normalizeDefaultDatabase(NodeDefinition $root_node): void
is_array($v) &&
!array_key_exists('default_database', $v) &&
array_key_exists('databases', $v) &&
is_array($v['databases']);
is_array($v['databases']) &&
$v['databases'];
})
->then(static function (array $v): array {
$keys = array_keys($v['databases']);
Expand Down
28 changes: 18 additions & 10 deletions tests/DependencyInjection/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,6 @@ public function getBadConfigs(): array
{
$return = [];
foreach (['/tmp/var/cache', null] as $cache_dir) {
$return[] = [$cache_dir, [
'gpslab_geoip' => [
'databases' => null,
],
]];
$return[] = [$cache_dir, [
'gpslab_geoip' => [
'databases' => [],
],
]];
$return[] = [$cache_dir, [
'gpslab_geoip' => [
'license' => 'LICENSE',
Expand Down Expand Up @@ -151,6 +141,24 @@ public function getConfigs(): array
'default_database' => 'default',
'databases' => [],
]];
$return[] = [$cache_dir, [
'gpslab_geoip' => [
'databases' => null,
],
], [
'databases' => [],
'locales' => ['en'],
'default_database' => 'default',
]];
$return[] = [$cache_dir, [
'gpslab_geoip' => [
'databases' => [],
],
], [
'databases' => [],
'locales' => ['en'],
'default_database' => 'default',
]];
$return[] = [$cache_dir, [
'gpslab_geoip' => [
'license' => 'LICENSE',
Expand Down

0 comments on commit 2cd2ae7

Please sign in to comment.