From d019cbb7079e4fc1dee46e701edd3041f62e0662 Mon Sep 17 00:00:00 2001 From: Jacob Emerick Date: Fri, 18 Dec 2015 12:11:24 -0700 Subject: [PATCH] Adds LoggingPdo helper, adds test for pulling internal logger --- src/PhpQuickProfiler.php | 2 +- tests/bootstrap.php | 3 ++- tests/helpers/LoggingPdo.php | 10 ++++++++++ tests/{ => helpers}/function-overrides.php | 0 tests/unit/PhpQuickProfilerTest.php | 14 ++++++++++++-- 5 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 tests/helpers/LoggingPdo.php rename tests/{ => helpers}/function-overrides.php (100%) diff --git a/src/PhpQuickProfiler.php b/src/PhpQuickProfiler.php index 188e24f..16cf51a 100644 --- a/src/PhpQuickProfiler.php +++ b/src/PhpQuickProfiler.php @@ -17,7 +17,7 @@ class PhpQuickProfiler { - /** @var integer */ + /** @var double */ protected $startTime; /** @var Console */ diff --git a/tests/bootstrap.php b/tests/bootstrap.php index d4ef22c..8634fc5 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,4 +1,5 @@ dataProfiledQueries(); + $dbConnection = self::$dbConnection; + $dbConnection->queries = $profiledQueries; + $profiler = new PhpQuickProfiler(); + $profiler->gatherQueryData($dbConnection); + + $this->assertAttributeSame($profiledQueries, 'profiledQueries', $profiler); + } + /** * @dataProvider dataProfiledQueries */