File tree Expand file tree Collapse file tree 5 files changed +55
-3
lines changed Expand file tree Collapse file tree 5 files changed +55
-3
lines changed Original file line number Diff line number Diff line change 22
33The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release.
44
5+ ## unreleased
6+
7+ ### Fixed
8+
9+ - Display of the profiler panel when used in a symfony/flex project.
10+
511## 1.7.0 - 2017-07-25
612
713### Added
Original file line number Diff line number Diff line change 1414 </service >
1515
1616 <service id =" httplug.collector.collector" class =" Http\HttplugBundle\Collector\Collector" public =" false" >
17- <tag name =" data_collector" template =" HttplugBundle:: webprofiler.html.twig" priority =" 200" id =" httplug" />
17+ <tag name =" data_collector" template =" @Httplug/ webprofiler.html.twig" priority =" 200" id =" httplug" />
1818 </service >
1919
2020 <service id =" httplug.plugin.stack" class =" Http\HttplugBundle\Collector\StackPlugin" public =" false" abstract =" true" >
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Http \HttplugBundle \Tests \Functional ;
4+
5+ use Symfony \Bundle \FrameworkBundle \Test \WebTestCase ;
6+
7+ class ProfilerTest extends WebTestCase
8+ {
9+ public function testShowProfiler ()
10+ {
11+ $ client = static ::createClient ();
12+
13+ //Browse any page to get a profile
14+ $ client ->request ('GET ' , '/ ' );
15+
16+ $ crawler = $ client ->request ('GET ' , '/_profiler/latest?panel=httplug ' );
17+ $ title = $ crawler ->filterXPath ('//*[@id="collector-content"]/h2 ' );
18+
19+ $ this ->assertCount (1 , $ title );
20+ $ this ->assertEquals ('HTTPlug ' , $ title ->html ());
21+ }
22+ }
Original file line number Diff line number Diff line change 11<?php
22
3+ use Symfony \Bundle \FrameworkBundle \Kernel \MicroKernelTrait ;
34use Symfony \Component \Config \Loader \LoaderInterface ;
5+ use Symfony \Component \DependencyInjection \ContainerBuilder ;
6+ use Symfony \Component \HttpFoundation \Response ;
47use Symfony \Component \HttpKernel \Kernel ;
8+ use Symfony \Component \Routing \RouteCollectionBuilder ;
59
610class AppKernel extends Kernel
711{
12+ use MicroKernelTrait;
13+
814 /**
915 * {@inheritdoc}
1016 */
@@ -26,14 +32,24 @@ public function registerBundles()
2632 /**
2733 * {@inheritdoc}
2834 */
29- public function registerContainerConfiguration ( LoaderInterface $ loader )
35+ protected function configureContainer ( ContainerBuilder $ container , LoaderInterface $ loader )
3036 {
3137 $ loader ->load (__DIR__ .'/config/config_ ' .$ this ->getEnvironment ().'.yml ' );
3238 if ($ this ->isDebug ()) {
3339 $ loader ->load (__DIR__ .'/config/config_debug.yml ' );
3440 }
3541 }
3642
43+ /**
44+ * {@inheritdoc}
45+ */
46+ protected function configureRoutes (RouteCollectionBuilder $ routes )
47+ {
48+ $ routes ->import ('@WebProfilerBundle/Resources/config/routing/wdt.xml ' , '/_wdt ' );
49+ $ routes ->import ('@WebProfilerBundle/Resources/config/routing/profiler.xml ' , '/_profiler ' );
50+ $ routes ->add ('/ ' , 'kernel:indexAction ' );
51+ }
52+
3753 /**
3854 * {@inheritdoc}
3955 */
@@ -57,4 +73,9 @@ protected function getContainerBaseClass()
5773 {
5874 return '\PSS\SymfonyMockerContainer\DependencyInjection\MockerContainer ' ;
5975 }
76+
77+ public function indexAction ()
78+ {
79+ return new Response ();
80+ }
6081}
Original file line number Diff line number Diff line change 2828 "symfony/framework-bundle" : " ^2.8 || ^3.0" ,
2929 "php-http/message" : " ^1.4" ,
3030 "php-http/discovery" : " ^1.0" ,
31- "twig/twig" : " ^1.18 || ^2.0"
31+ "twig/twig" : " ^1.18 || ^2.0" ,
32+ "symfony/asset" : " ^2.8 || ^3.0"
3233 },
3334 "require-dev" : {
3435 "phpunit/phpunit" : " ^4.5 || ^5.4" ,
4546 "symfony/web-profiler-bundle" : " ^2.8 || ^3.0" ,
4647 "symfony/finder" : " ^2.7 || ^3.0" ,
4748 "symfony/cache" : " ^3.1" ,
49+ "symfony/browser-kit" : " ^2.8 || ^3.0" ,
50+ "symfony/dom-crawler" : " ^2.8 || ^3.0" ,
4851 "polishsymfonycommunity/symfony-mocker-container" : " ^1.0" ,
4952 "matthiasnoback/symfony-dependency-injection-test" : " ^1.0" ,
5053 "nyholm/nsa" : " ^1.1"
You can’t perform that action at this time.
0 commit comments