Skip to content

Commit a5130b2

Browse files
minor symfony#24130 Fixed deprecations in WebProfiler tests (javiereguiluz)
This PR was merged into the 3.4 branch. Discussion ---------- Fixed deprecations in WebProfiler tests | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - To avoid this error in tests: ``` The "web_profiler.position" configuration key has been deprecated in Symfony 3.4 and it will be removed in 4.0: 1x 1x in ConfigurationTest::testConfigTree from Symfony\Bundle\WebProfilerBundle\Tests\DependencyInjection ``` Can anybody propose a better solution to fix this issue? Thanks! Commits ------- 2a696d3 Fixed deprecations in WebProfiler tests
2 parents 1677d9c + 2a696d3 commit a5130b2

File tree

4 files changed

+31
-4
lines changed

4 files changed

+31
-4
lines changed

src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ CHANGELOG
5353
`EventDispatcherDebugCommand`, `RouterDebugCommand`, `RouterMatchCommand`,
5454
`TranslationDebugCommand`, `TranslationUpdateCommand`, `XliffLintCommand`
5555
and `YamlLintCommand` classes have been marked as final
56-
* Deprecated the `web_profiler.position` config option (in Symfony 4.0 the toolbar
57-
will always be displayed at the bottom).
5856

5957
3.3.0
6058
-----

src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
CHANGELOG
22
=========
33

4+
3.4.0
5+
-----
6+
7+
* Deprecated the `web_profiler.position` config option (in 4.0 version the toolbar
8+
will always be displayed at the bottom) and the `web_profiler.debug_toolbar.position`
9+
container parameter.
10+
411
3.1.0
512
-----
613

src/Symfony/Bundle/WebProfilerBundle/Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,36 @@ public function testConfigTree($options, $results)
2929
$this->assertEquals($results, $config);
3030
}
3131

32+
/**
33+
* @dataProvider getPositionConfig
34+
* @group legacy
35+
* @expectedDeprecation The "web_profiler.position" configuration key has been deprecated in Symfony 3.4 and it will be removed in 4.0.
36+
*/
37+
public function testPositionConfig($options, $results)
38+
{
39+
$processor = new Processor();
40+
$configuration = new Configuration();
41+
$config = $processor->processConfiguration($configuration, array($options));
42+
43+
$this->assertEquals($results, $config);
44+
}
45+
3246
public function getDebugModes()
3347
{
3448
return array(
3549
array(array(), array('intercept_redirects' => false, 'toolbar' => false, 'position' => 'bottom', 'excluded_ajax_paths' => '^/(app(_[\\w]+)?\\.php/)?_wdt')),
3650
array(array('intercept_redirects' => true), array('intercept_redirects' => true, 'toolbar' => false, 'position' => 'bottom', 'excluded_ajax_paths' => '^/(app(_[\\w]+)?\\.php/)?_wdt')),
3751
array(array('intercept_redirects' => false), array('intercept_redirects' => false, 'toolbar' => false, 'position' => 'bottom', 'excluded_ajax_paths' => '^/(app(_[\\w]+)?\\.php/)?_wdt')),
3852
array(array('toolbar' => true), array('intercept_redirects' => false, 'toolbar' => true, 'position' => 'bottom', 'excluded_ajax_paths' => '^/(app(_[\\w]+)?\\.php/)?_wdt')),
39-
array(array('position' => 'top'), array('intercept_redirects' => false, 'toolbar' => false, 'position' => 'top', 'excluded_ajax_paths' => '^/(app(_[\\w]+)?\\.php/)?_wdt')),
4053
array(array('excluded_ajax_paths' => 'test'), array('intercept_redirects' => false, 'toolbar' => false, 'position' => 'bottom', 'excluded_ajax_paths' => 'test')),
4154
);
4255
}
56+
57+
public function getPositionConfig()
58+
{
59+
return array(
60+
array(array('position' => 'top'), array('intercept_redirects' => false, 'toolbar' => false, 'excluded_ajax_paths' => '^/(app(_[\\w]+)?\\.php/)?_wdt', 'position' => 'top')),
61+
array(array('position' => 'bottom'), array('intercept_redirects' => false, 'toolbar' => false, 'excluded_ajax_paths' => '^/(app(_[\\w]+)?\\.php/)?_wdt', 'position' => 'bottom')),
62+
);
63+
}
4364
}

src/Symfony/Bundle/WebProfilerBundle/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,13 @@
2525
"twig/twig": "~1.34|~2.4"
2626
},
2727
"require-dev": {
28-
"symfony/config": "~2.8|~3.0|~4.0",
28+
"symfony/config": "~3.4|~4.0",
2929
"symfony/console": "~2.8|~3.0|~4.0",
3030
"symfony/dependency-injection": "~3.3|~4.0",
3131
"symfony/stopwatch": "~2.8|~3.0|~4.0"
3232
},
3333
"conflict": {
34+
"symfony/config": "<3.4",
3435
"symfony/dependency-injection": "<3.3",
3536
"symfony/event-dispatcher": "<3.3",
3637
"symfony/var-dumper": "<3.3"

0 commit comments

Comments
 (0)