Skip to content

Commit b43e9b1

Browse files
committed
Fixed #1674: duplicated route prefix in profiler urls (tests)
1 parent 6ec4b13 commit b43e9b1

File tree

2 files changed

+461
-0
lines changed

2 files changed

+461
-0
lines changed

src/test/java/fr/adrienbrault/idea/symfony2plugin/tests/profiler/ProfilerUtilTest.java

+16
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,22 @@ public void testCreateRequestsFromIndexHtml() {
3939
assertEquals(404, request.getStatusCode());
4040
}
4141

42+
/**
43+
* @see ProfilerUtil#createRequestsFromIndexHtml
44+
*/
45+
public void testCreateRequestsFromIndexHtmlRemovesProfilerRoutePrefixFromTokenLinks() {
46+
PsiFile psiFile = myFixture.configureByFile("profiler-index-with-route-prefix.html");
47+
Collection<ProfilerRequestInterface> requests = ProfilerUtil.createRequestsFromIndexHtml(getProject(), psiFile.getText(), "http://127.0.0.1:8000/prefix/");
48+
49+
ProfilerRequestInterface request = requests.iterator().next();
50+
51+
assertEquals("a9eaab", request.getHash());
52+
assertEquals("GET", request.getMethod());
53+
assertEquals("http://127.0.0.1:8000/prefix/_profiler/search/results?ip=&amp;limit=10", request.getUrl());
54+
assertEquals("http://127.0.0.1:8000/prefix/_profiler/a9eaab", request.getProfilerUrl());
55+
assertEquals(404, request.getStatusCode());
56+
}
57+
4258
/**
4359
* @see ProfilerUtil#getRequestAttributes
4460
*/

0 commit comments

Comments
 (0)