| @@ 139-150 (lines=12) @@ | ||
| 136 | /** |
|
| 137 | * @expectedException Exception |
|
| 138 | */ |
|
| 139 | public function testExplainQueryBadParametersException() |
|
| 140 | { |
|
| 141 | $query = 'SELECT * FROM `testing` WHERE `title` = :title'; |
|
| 142 | $invalidParams = array('id' => 1); |
|
| 143 | $profiler = new PhpQuickProfiler(); |
|
| 144 | $reflectedMethod = $this->getAccessibleMethod($profiler, 'explainQuery'); |
|
| 145 | ||
| 146 | $explainedQuery = $reflectedMethod->invokeArgs( |
|
| 147 | $profiler, |
|
| 148 | array(self::$dbConnection, $query, $invalidParams) |
|
| 149 | ); |
|
| 150 | } |
|
| 151 | ||
| 152 | /** |
|
| 153 | * @dataProvider dataConnectionDrivers |
|
| @@ 174-185 (lines=12) @@ | ||
| 171 | /** |
|
| 172 | * @expectedException Exception |
|
| 173 | */ |
|
| 174 | public function testGetExplainQueryUnsupportedDriver() |
|
| 175 | { |
|
| 176 | $query = 'SELECT * FROM `testing`'; |
|
| 177 | $unsupportedDriver = 'zz'; |
|
| 178 | $profiler = new PhpQuickProfiler(); |
|
| 179 | $reflectedMethod = $this->getAccessibleMethod($profiler, 'getExplainQuery'); |
|
| 180 | ||
| 181 | $explainQuery = $reflectedMethod->invokeArgs( |
|
| 182 | $profiler, |
|
| 183 | array($query, $unsupportedDriver) |
|
| 184 | ); |
|
| 185 | } |
|
| 186 | ||
| 187 | public function testGatherSpeedData() |
|
| 188 | { |
|