diff --git a/Resources/views/webprofiler.html.twig b/Resources/views/webprofiler.html.twig
new file mode 100644
index 00000000..93c70996
--- /dev/null
+++ b/Resources/views/webprofiler.html.twig
@@ -0,0 +1,75 @@
+{% extends '@WebProfiler/Profiler/layout.html.twig' %}
+
+{% import _self as macro %}
+
+{% block toolbar %}
+ {% if collector.totalRequests > 0 %}
+ {% set icon %}
+ {{ include('@WebProfiler/Icon/ajax.svg') }}
+ {{ collector.totalRequests }}
+ {% endset %}
+
+ {% set text %}
+
+ Successful requests
+ {{ collector.sucessfulRequests|length }}
+
+
+ Faild requests
+ {{ collector.failedRequests|length }}
+
+
+ {% endset %}
+ {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': profiler_url } %}
+ {% endif %}
+{% endblock %}
+
+{% block head %}
+ {# Optional. Here you can link to or define your own CSS and JS contents. #}
+ {{ parent() }}
+{% endblock %}
+
+{% block menu %}
+ {# This left-hand menu appears when using the full-screen profiler. #}
+
+ {{ include('@WebProfiler/Icon/ajax.svg') }}
+ Httplug
+
+{% endblock %}
+
+{% block panel %}
+ HTTPlug
+ {% if (collector.failedRequests|length > 0) %}
+ Failed requests
+ {{ macro.printMessages(collector.failedRequests) }}
+ {% endif %}
+
+ {% if (collector.sucessfulRequests|length > 0) %}
+ Successful requests
+ {{ macro.printMessages(collector.sucessfulRequests) }}
+ {% endif %}
+
+ {% if collector.totalRequests == 0 %}
+
+
+
No request were sent.
+
+ {% endif %}
+
+{% endblock %}
+
+{% macro printMessages(messages) %}
+
+
+ Request |
+ Response |
+
+
+ {% for message in messages %}
+
+ {{ message['request'] }} |
+ {{ message['response'] }} |
+
+ {% endfor %}
+
+{% endmacro %}
diff --git a/Tests/Resources/Fixtures/config/empty.php b/Tests/Resources/Fixtures/config/empty.php
index d599ed25..02c22151 100644
--- a/Tests/Resources/Fixtures/config/empty.php
+++ b/Tests/Resources/Fixtures/config/empty.php
@@ -1,3 +1,3 @@
loadFromExtension('httplug', array());
+$container->loadFromExtension('httplug', []);
diff --git a/Tests/Resources/Fixtures/config/full.php b/Tests/Resources/Fixtures/config/full.php
index 66aba790..2883da4d 100644
--- a/Tests/Resources/Fixtures/config/full.php
+++ b/Tests/Resources/Fixtures/config/full.php
@@ -1,16 +1,16 @@
loadFromExtension('httplug', array(
- 'main_alias' => array(
- 'client' => 'my_client',
+$container->loadFromExtension('httplug', [
+ 'main_alias' => [
+ 'client' => 'my_client',
'message_factory' => 'my_message_factory',
- 'uri_factory' => 'my_uri_factory',
- 'stream_factory' => 'my_stream_factory',
- ),
- 'classes' => array(
- 'client' => 'Http\Adapter\Guzzle6\Client',
+ 'uri_factory' => 'my_uri_factory',
+ 'stream_factory' => 'my_stream_factory',
+ ],
+ 'classes' => [
+ 'client' => 'Http\Adapter\Guzzle6\Client',
'message_factory' => 'Http\Message\MessageFactory\GuzzleMessageFactory',
- 'uri_factory' => 'Http\Message\UriFactory\GuzzleUriFactory',
- 'stream_factory' => 'Http\Message\StreamFactory\GuzzleStreamFactory',
- ),
-));
+ 'uri_factory' => 'Http\Message\UriFactory\GuzzleUriFactory',
+ 'stream_factory' => 'Http\Message\StreamFactory\GuzzleStreamFactory',
+ ],
+]);
diff --git a/Tests/Resources/app/AppKernel.php b/Tests/Resources/app/AppKernel.php
index 1d821d12..a6fb0780 100644
--- a/Tests/Resources/app/AppKernel.php
+++ b/Tests/Resources/app/AppKernel.php
@@ -10,10 +10,10 @@ class AppKernel extends Kernel
*/
public function registerBundles()
{
- return array(
+ return [
new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new \Http\HttplugBundle\HttplugBundle(),
- );
+ ];
}
/**
diff --git a/Tests/Unit/DependencyInjection/ConfigurationTest.php b/Tests/Unit/DependencyInjection/ConfigurationTest.php
index 0c7d4523..84a64eac 100644
--- a/Tests/Unit/DependencyInjection/ConfigurationTest.php
+++ b/Tests/Unit/DependencyInjection/ConfigurationTest.php
@@ -37,6 +37,10 @@ public function testEmptyConfiguration()
'stream_factory' => null,
],
'clients' => [],
+ 'toolbar' => [
+ 'enabled' => 'auto',
+ 'formatter' => null,
+ ],
];
$formats = array_map(function ($path) {
@@ -68,6 +72,10 @@ public function testSupportsAllConfigFormats()
'stream_factory' => 'Http\Message\StreamFactory\GuzzleStreamFactory',
],
'clients' => [],
+ 'toolbar' => [
+ 'enabled' => 'auto',
+ 'formatter' => null,
+ ],
];
$formats = array_map(function ($path) {