10000 [DependencyInjection] Test constants by gnugat · Pull Request #8663 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[DependencyInjection] Test constants #8663

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[DIC] Indented expected values
In order to make more readable future diffs, expected values have been
indented.

This means that if someone adds a new value at the end of the array, the
diff will only print the new line with only the new addition, instead of
of deletion of the whole array and addition with the whole array with
the new value.
  • Loading branch information
Loïc Chardonnet committed Aug 4, 2013
commit f9463daf2806e53b546f6c5c27e29e252c878a81
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,26 @@ public function testLoadParameters()
$loader->load('services2.xml');

$actual = $container->getParameterBag()->all();
$expected = array('a string', 'foo' => 'bar', 'values' => array(0, 'integer' => 4, 100 => null, 'true', true, false, 'on', 'off', 'float' => 1.3, 1000.3, 'a string', array('foo', 'bar')), 'foo_bar' => new Reference('foo_bar'), 'mixedcase' => array('MixedCaseKey' => 'value'));
$expected = array(
'a string',
'foo' => 'bar',
'values' => array(
0,
'integer' => 4,
100 => null,
'true',
true,
false,
'on',
'off',
'float' => 1.3,
1000.3,
'a string',
array('foo', 'bar')
),
'foo_bar' => new Reference('foo_bar'),
'mixedcase' => array('MixedCaseKey' => 'value'),
);

$this->assertEquals($expected, $actual, '->load() converts XML values to PHP ones');
}
Expand All @@ -120,7 +139,29 @@ public function testLoadImports()
$loader->load('services4.xml');

$actual = $container->getParameterBag()->all();
$expected = array('a string', 'foo' => 'bar', 'values' => array(true, false), 'foo_bar' => new Reference('foo_bar'), 'mixedcase' => array('MixedCaseKey' => 'value'), 'bar' => '%foo%', 'imported_from_ini' => true, 'imported_from_yaml' => true);
$expected = array(
'a string',
'foo' => 'bar',
'values' => array(
0,
'integer' => 4,
100 => null,
'true',
true,
false,
'on',
'off',
'float' => 1.3,
1000.3,
'a string',
array('foo', 'bar')
),
'foo_bar' => new Reference('foo_bar'),
'mixedcase' => array('MixedCaseKey' => 'value'),
'bar' => '%foo%',
'imported_from_ini' => true,
'imported_from_yaml' => true
);

$this->assertEquals(array_keys($expected), array_keys($actual), '->load() imports and merges imported files');

Expand Down
0