ClientBuilder example


class ClientProfilerTest extends TestCase
{
    /** * @dataProvider providerQueries * * @param string|array<string> $index */
    public function testProfiling(string|array $index, string $expectedUrl): void
    {
        $builder = new ClientBuilder();
        $builder->setHandler(fn () => new FutureArray(resolve([
            'status' => 200,
            'body' => fopen('php://memory', 'rb'),
            'transfer_stats' => [
                'total_time' => 0,
            ],
            'effective_url' => 'http://localhost:9200/test/_search',
        ])));

        $profiler = new ClientProfiler($builder->build());

        
Home | Imprint | This part of the site doesn't use cookies.