LazyRecord\Testing\ModelProfileTestCase::tearDown PHP Method

tearDown() public method

public tearDown ( )
    public function tearDown()
    {
        if (!extension_loaded('xhprof')) {
            return parent::tearDown();
        }
        $xhprofData = xhprof_disable();
        $this->endTime = microtime(true);
        if (defined('ARRAY_FILTER_USE_KEY')) {
            // ignore all phpunit related keys
            // var_dump($xhprofData);
            $xhprofData = array_filter($xhprofData, function ($key) {
                return !preg_match('/PHPUnit/', $key);
            }, ARRAY_FILTER_USE_KEY);
        }
        include_once $_ENV['XHPROF_ROOT'] . '/xhprof_lib/utils/xhprof_lib.php';
        include_once $_ENV['XHPROF_ROOT'] . '/xhprof_lib/utils/xhprof_runs.php';
        $namespace = 'LazyRecord:' . $this->getName();
        $runs = new XHProfRuns_Default();
        $runId = $runs->save_run($xhprofData, $namespace);
        $host = 'localhost';
        if (isset($_ENV['XHPROF_HOST'])) {
            $host = $_ENV['XHPROF_HOST'];
        }
        echo "\n---------------------------------\n";
        printf("Profile test %d times spent %.2f seconds\n", $this->N, $this->endTime - $this->startTime);
        printf("See profiling result at http://%s/index.php?run=%s&source=%s\n", $host, $runId, $namespace);
        parent::tearDown();
    }
ModelProfileTestCase