8000 Merge branch '2.7' · ostrolucky/symfony@02f9473 · GitHub
[go: up one dir, main page]

Skip to content

Commit 02f9473

Browse files
committed
Merge branch '2.7'
* 2.7: fixed tests [OptionsResolver] replaced some exception messages Added i18n support to ConfirmationQuestion [HttpKernel] [WebProfilerBundle] added HTTP status to profiler search result [Form] fixed form tests when using 2.7 deps [2.3] [HttpFoundation] [MimeTypeGuesser] [Routing] merge instead of replace class and method scheme/method annotations [TwigBridge] Fix bootstrap rendering when user explicitly use form_label Removed dead code and various cleaning Removed dead code and various cleaning Fixed HtmlDumper with long string Removed dead code and various cleaning [FrameworkBundle][xsd] added missing logging attribute. [Console] Make it clear that the second argument is not about command options. Added the '-' character for spaceless on tag start and end to be consistent for block, if, set and for nodes [Yaml] fixed parse shortcut Key after unindented collection. [Console] fixed symfony#10531 Make the container considered non-fresh if the environment parameters are changed Conflicts: src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig src/Symfony/Component/HttpKernel/CHANGELOG.md src/Symfony/Component/Process/Process.php
2 parents 7baa396 + 3a6f407 commit 02f9473

File tree

3 files changed

+76
-0
lines changed

3 files changed

+76
-0
lines changed

CHANGELOG.md

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

4+
2.7.0
5+
-----
6+
7+
* [BC BREAK] if you are using a DB to store profiles, the table must be dropped
8+
* added the HTTP status code to profiles
9+
410
2.3.0
511
-----
612

Resources/views/Profiler/results.html.twig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<th scope="col">Method</th>
1313
<th scope="col">URL</th>
1414
<th scope="col">Time</th>
15+
<th scope="col">Status</th>
1516
</tr>
1617
</thead>
1718
<tbody>
@@ -22,6 +23,13 @@
2223
<td>{{ elements.method }}</td>
2324
<td>{{ elements.url }}</td>
2425
<td>{{ elements.time|date('r') }}</td>
26+
<td>
27+
{% if elements.status_code is defined and elements.status_code %}
28+
{{ elements.status_code }}
29+
{% else %}
30+
unknown
31+
{% endif %}
32+
</td>
2533
</tr>
2634
{% endfor %}
2735
</tbody>

Tests/Controller/ProfilerControllerTest.php

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,66 @@ public function testReturns404onTokenNotFound()
7373
$response = $controller->toolbarAction(Request::create('/_wdt/notFound'), 'notFound');
7474
$this->assertEquals(404, $response->getStatusCode());
7575
}
76+
77+
public function testSearchResult()
78+
{
79+
$urlGenerator = $this->getMock('Symfony\Component\Routing\Generator\UrlGeneratorInterface');
80+
$twig = $this->getMock('Twig_Environment');
81+
$profiler = $this
82+
->getMockBuilder('Symfony\Component\HttpKernel\Profiler\Profiler')
83+
->disableOriginalConstructor()
84+
->getMock();
85+
86+
$controller = new ProfilerController($urlGenerator, $profiler, $twig, array());
87+
88+
$tokens = array(
89+
array(
90+
'token' => 'token1',
91+
'ip' => '127.0.0.1',
92+
'method' => 'GET',
93+
'url' => 'http://example.com/',
94+
'time' => 0,
95+
'parent' => null,
96+
'status_code' => 200,
97+
),
98+
array(
99+
'token' => 'token2',
100+
'ip' => '127.0.0.1',
101+
'method' => 'GET',
102+
'url' => 'http://example.com/not_found',
103+
'time' => 0,
104+
'parent' => null,
105+
'status_code' => 404,
106+
),
107+
);
108+
$profiler
109+
->expects($this->once())
110+
->method('find')
111+
->will($this->returnValue($tokens));
112+
113+
$twig->expects($this->once())
114+
->method('render')
115+
->with($this->stringEndsWith('results.html.twig'), $this->equalTo(array(
116+
'token' => 'empty',
117+
'profile' => null,
118+
'tokens' => $tokens,
119+
'ip' => '127.0.0.1',
120+
'method' => 'GET',
121+
'url' => 'http://example.com/',
122+
'start' => null,
123+
'end' => null,
124+
'limit' => 2,
125+
'panel' => null,
126+
)));
127+
128+
$response = $controller->searchResultsAction(
129+
Request::create(
130+
'/_profiler/empty/search/results',
131+
'GET',
132+
array('limit' => 2, 'ip' => '127.0.0.1', 'method' => 'GET', 'url' => 'http://example.com/')
133+
),
134+
'empty'
135+
);
136+
$this->assertEquals(200, $response->getStatusCode());
137+
}
76138
}

0 commit comments

Comments
 (0)
0