Code Duplication    Length = 12-12 lines in 4 locations

tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php 4 locations

@@ 213-224 (lines=12) @@
210
     * @group DBAL-209
211
     * @expectedException \Doctrine\DBAL\DBALException
212
     */
213
    public function testFetchAllWithMissingTypes()
214
    {
215
        if ($this->_conn->getDriver() instanceof \Doctrine\DBAL\Driver\Mysqli\Driver ||
216
            $this->_conn->getDriver() instanceof \Doctrine\DBAL\Driver\SQLSrv\Driver) {
217
            $this->markTestSkipped('mysqli and sqlsrv actually supports this');
218
        }
219
220
        $datetimeString = '2010-01-01 10:10:10';
221
        $datetime = new \DateTime($datetimeString);
222
        $sql = "SELECT test_int, test_datetime FROM fetch_table WHERE test_int = ? AND test_datetime = ?";
223
        $data = $this->_conn->fetchAll($sql, array(1, $datetime));
224
    }
225
226
    public function testFetchBoth()
227
    {
@@ 279-290 (lines=12) @@
276
    /**
277
     * @expectedException \Doctrine\DBAL\DBALException
278
     */
279
    public function testFetchAssocWithMissingTypes()
280
    {
281
        if ($this->_conn->getDriver() instanceof \Doctrine\DBAL\Driver\Mysqli\Driver ||
282
            $this->_conn->getDriver() instanceof \Doctrine\DBAL\Driver\SQLSrv\Driver) {
283
            $this->markTestSkipped('mysqli and sqlsrv actually supports this');
284
        }
285
286
        $datetimeString = '2010-01-01 10:10:10';
287
        $datetime = new \DateTime($datetimeString);
288
        $sql = "SELECT test_int, test_datetime FROM fetch_table WHERE test_int = ? AND test_datetime = ?";
289
        $row = $this->_conn->fetchAssoc($sql, array(1, $datetime));
290
    }
291
292
    public function testFetchArray()
293
    {
@@ 319-330 (lines=12) @@
316
    /**
317
     * @expectedException \Doctrine\DBAL\DBALException
318
     */
319
    public function testFetchArrayWithMissingTypes()
320
    {
321
        if ($this->_conn->getDriver() instanceof \Doctrine\DBAL\Driver\Mysqli\Driver ||
322
            $this->_conn->getDriver() instanceof \Doctrine\DBAL\Driver\SQLSrv\Driver) {
323
            $this->markTestSkipped('mysqli and sqlsrv actually supports this');
324
        }
325
326
        $datetimeString = '2010-01-01 10:10:10';
327
        $datetime = new \DateTime($datetimeString);
328
        $sql = "SELECT test_int, test_datetime FROM fetch_table WHERE test_int = ? AND test_datetime = ?";
329
        $row = $this->_conn->fetchArray($sql, array(1, $datetime));
330
    }
331
332
    public function testFetchColumn()
333
    {
@@ 360-371 (lines=12) @@
357
    /**
358
     * @expectedException \Doctrine\DBAL\DBALException
359
     */
360
    public function testFetchColumnWithMissingTypes()
361
    {
362
        if ($this->_conn->getDriver() instanceof \Doctrine\DBAL\Driver\Mysqli\Driver ||
363
            $this->_conn->getDriver() instanceof \Doctrine\DBAL\Driver\SQLSrv\Driver) {
364
            $this->markTestSkipped('mysqli and sqlsrv actually supports this');
365
        }
366
367
        $datetimeString = '2010-01-01 10:10:10';
368
        $datetime = new \DateTime($datetimeString);
369
        $sql = "SELECT test_int, test_datetime FROM fetch_table WHERE test_int = ? AND test_datetime = ?";
370
        $column = $this->_conn->fetchColumn($sql, array(1, $datetime), 1);
371
    }
372
373
    /**
374
     * @group DDC-697