-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathProfilerTest.php
More file actions
36 lines (28 loc) · 1003 Bytes
/
ProfilerTest.php
File metadata and controls
36 lines (28 loc) · 1003 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
declare(strict_types=1);
namespace Http\HttplugBundle\Tests\Functional;
use GuzzleHttp\Psr7\Request;
use PHPUnit\Framework\Attributes\Group;
use Psr\Http\Client\ClientInterface;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
final class ProfilerTest extends WebTestCase
{
/**
* @group legacy
*/
#[Group('legacy')]
public function testShowProfiler(): void
{
$client = static::createClient();
$httpClient = $client->getContainer()->get('httplug.client.acme');
assert($httpClient instanceof ClientInterface);
$httpClient->sendRequest(new Request('GET', '/posts/1'));
// Browse any page to get a profile
$client->request('GET', '/');
$client->request('GET', '/_profiler/latest?panel=httplug');
$content = $client->getResponse()->getContent();
$this->assertStringContainsString(<<<HTML
<span class="httplug-host">jsonplaceholder.typicode.com</span>
HTML, $content);
}
}