Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit37f3d29

Browse files
committed
do not revert tests changes
1 parent679c656 commit37f3d29

File tree

2 files changed

+135
-15
lines changed

2 files changed

+135
-15
lines changed

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

Lines changed: 62 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,78 @@ class ConfigurationTest extends TestCase
2020
/**
2121
* @dataProvider getDebugModes
2222
*/
23-
publicfunctiontestConfigTree($options,$results)
23+
publicfunctiontestConfigTree(array$options,array$expectedResult)
2424
{
2525
$processor =newProcessor();
2626
$configuration =newConfiguration();
2727
$config =$processor->processConfiguration($configuration, [$options]);
2828

29-
$this->assertEquals($results,$config);
29+
$this->assertEquals($expectedResult,$config);
3030
}
3131

3232
publicfunctiongetDebugModes()
3333
{
3434
return [
35-
[[], ['intercept_redirects' =>false,'toolbar' =>false,'excluded_ajax_paths' =>'^/((index|app(_[\w]+)?)\.php/)?_wdt']],
36-
[['intercept_redirects' =>true], ['intercept_redirects' =>true,'toolbar' =>false,'excluded_ajax_paths' =>'^/((index|app(_[\w]+)?)\.php/)?_wdt']],
37-
[['intercept_redirects' =>false], ['intercept_redirects' =>false,'toolbar' =>false,'excluded_ajax_paths' =>'^/((index|app(_[\w]+)?)\.php/)?_wdt']],
38-
[['toolbar' =>true], ['intercept_redirects' =>false,'toolbar' =>true,'excluded_ajax_paths' =>'^/((index|app(_[\w]+)?)\.php/)?_wdt']],
39-
[['excluded_ajax_paths' =>'test'], ['intercept_redirects' =>false,'toolbar' =>false,'excluded_ajax_paths' =>'test']],
35+
[
36+
'options' => [],
37+
'expectedResult' => [
38+
'intercept_redirects' =>false,
39+
'toolbar' =>false,
40+
'excluded_ajax_paths' =>'^/((index|app(_[\w]+)?)\.php/)?_wdt',
41+
],
42+
],
43+
[
44+
'options' => ['toolbar' =>true],
45+
'expectedResult' => [
46+
'intercept_redirects' =>false,
47+
'toolbar' =>true,
48+
'excluded_ajax_paths' =>'^/((index|app(_[\w]+)?)\.php/)?_wdt',
49+
],
50+
],
51+
[
52+
'options' => ['excluded_ajax_paths' =>'test'],
53+
'expectedResult' => [
54+
'intercept_redirects' =>false,
55+
'toolbar' =>false,
56+
'excluded_ajax_paths' =>'test',
57+
],
58+
],
59+
];
60+
}
61+
62+
/**
63+
* @group legacy
64+
*
65+
* @dataProvider getInterceptRedirectsConfiguration
66+
*/
67+
publicfunctiontestConfigTreeUsingInterceptRedirects(bool$interceptRedirects,array$expectedResult)
68+
{
69+
$processor =newProcessor();
70+
$configuration =newConfiguration();
71+
$config =$processor->processConfiguration($configuration, [['intercept_redirects' =>$interceptRedirects]]);
72+
73+
$this->assertEquals($expectedResult,$config);
74+
}
75+
76+
publicfunctiongetInterceptRedirectsConfiguration()
77+
{
78+
return [
79+
[
80+
'interceptRedirects' =>true,
81+
'expectedResult' => [
82+
'intercept_redirects' =>true,
83+
'toolbar' =>false,
84+
'excluded_ajax_paths' =>'^/((index|app(_[\w]+)?)\.php/)?_wdt',
85+
],
86+
],
87+
[
88+
'interceptRedirects' =>false,
89+
'expectedResult' => [
90+
'intercept_redirects' =>false,
91+
'toolbar' =>false,
92+
'excluded_ajax_paths' =>'^/((index|app(_[\w]+)?)\.php/)?_wdt',
93+
],
94+
],
4095
];
4196
}
4297
}

‎src/Symfony/Bundle/WebProfilerBundle/Tests/DependencyInjection/WebProfilerExtensionTest.php‎

Lines changed: 73 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,21 @@ public function testDefaultConfig($debug)
9999
self::assertSaneContainer($this->getCompiledContainer());
100100
}
101101

102+
publicfunctiongetDebugModes()
103+
{
104+
return [
105+
['debug' =>false],
106+
['debug' =>true],
107+
];
108+
}
109+
102110
/**
103-
* @dataProvidergetDebugModes
111+
* @dataProvidergetToolbarConfig
104112
*/
105-
publicfunctiontestToolbarConfig($toolbarEnabled,$interceptRedirects,$listenerInjected,$listenerEnabled)
113+
publicfunctiontestToolbarConfig(bool$toolbarEnabled,bool$listenerInjected,bool$listenerEnabled)
106114
{
107115
$extension =newWebProfilerExtension();
108-
$extension->load([['toolbar' =>$toolbarEnabled,'intercept_redirects' =>$interceptRedirects]],$this->container);
116+
$extension->load([['toolbar' =>$toolbarEnabled]],$this->container);
109117
$this->container->removeDefinition('web_profiler.controller.exception');
110118

111119
$this->assertSame($listenerInjected,$this->container->has('web_profiler.debug_toolbar'));
@@ -117,13 +125,70 @@ public function testToolbarConfig($toolbarEnabled, $interceptRedirects, $listene
117125
}
118126
}
119127

120-
publicfunctiongetDebugModes()
128+
publicfunctiongetToolbarConfig()
129+
{
130+
return [
131+
[
132+
'toolbarEnabled' =>false,
133+
'listenerInjected' =>false,
134+
'listenerEnabled' =>false,
135+
],
136+
[
137+
'toolbarEnabled' =>true,
138+
'listenerInjected' =>true,
139+
'listenerEnabled' =>true,
140+
],
141+
];
142+
}
143+
144+
/**
145+
* @group legacy
146+
*
147+
* @dataProvider getInterceptRedirectsToolbarConfig
148+
*/
149+
publicfunctiontestToolbarConfigUsingInterceptRedirects(
150+
bool$toolbarEnabled,
151+
bool$interceptRedirects,
152+
bool$listenerInjected,
153+
bool$listenerEnabled
154+
) {
155+
$extension =newWebProfilerExtension();
156+
$extension->load(
157+
[['toolbar' =>$toolbarEnabled,'intercept_redirects' =>$interceptRedirects]],
158+
$this->container
159+
);
160+
$this->container->removeDefinition('web_profiler.controller.exception');
161+
162+
$this->assertSame($listenerInjected,$this->container->has('web_profiler.debug_toolbar'));
163+
164+
self::assertSaneContainer($this->getCompiledContainer(),'', ['web_profiler.csp.handler']);
165+
166+
if ($listenerInjected) {
167+
$this->assertSame($listenerEnabled,$this->container->get('web_profiler.debug_toolbar')->isEnabled());
168+
}
169+
}
170+
171+
publicfunctiongetInterceptRedirectsToolbarConfig()
121172
{
122173
return [
123-
[false,false,false,false],
124-
[true,false,true,true],
125-
[false,true,true,false],
126-
[true,true,true,true],
174+
[
175+
'toolbarEnabled' =>false,
176+
'interceptRedirects' =>true,
177+
'listenerInjected' =>true,
178+
'listenerEnabled' =>false,
179+
],
180+
[
181+
'toolbarEnabled' =>false,
182+
'interceptRedirects' =>false,
183+
'listenerInjected' =>false,
184+
'listenerEnabled' =>false,
185+
],
186+
[
187+
'toolbarEnabled' =>true,
188+
'interceptRedirects' =>true,
189+
'listenerInjected' =>true,
190+
'listenerEnabled' =>true,
191+
],
127192
];
128193
}
129194

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp