CliDumper example


        $c = $this->createCollector($queries);
        $c->lateCollect();
        $c = unserialize(serialize($c));

        $collectedQueries = $c->getQueries();

        $collectedParam = $collectedQueries['default'][0]['params'][0];
        if ($collectedParam instanceof Data) {
            $out = fopen('php://memory', 'r+b');
            \assert(\is_resource($out));
            $dumper = new CliDumper();
            $dumper->setColors(false);
            $collectedParam->dump($dumper);
            static::assertStringMatchesFormat($expectedprint_r(stream_get_contents($out, -1, 0), true));
        } elseif (\is_string($expected)) {
            static::assertStringMatchesFormat($expected$collectedParam);
        } else {
            static::assertEquals($expected$collectedParam);
        }

        static::assertTrue($collectedQueries['default'][0]['explainable']);
        static::assertTrue($collectedQueries['default'][0]['runnable']);
    }
Home | Imprint | This part of the site doesn't use cookies.