Code Duplication    Length = 18-21 lines in 2 locations

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

@@ 683-703 (lines=21) @@
680
    /**
681
     * @group DBAL-196
682
     */
683
    public function testFetchAllSupportFetchClass()
684
    {
685
        $this->skipOci8AndMysqli();
686
        $this->setupFixture();
687
688
        $sql    = "SELECT test_int, test_string, test_datetime FROM fetch_table";
689
        $stmt   = $this->_conn->prepare($sql);
690
        $stmt->execute();
691
692
        $results = $stmt->fetchAll(
693
            \PDO::FETCH_CLASS,
694
            __NAMESPACE__.'\\MyFetchClass'
695
        );
696
697
        self::assertEquals(1, count($results));
698
        self::assertInstanceOf(__NAMESPACE__.'\\MyFetchClass', $results[0]);
699
700
        self::assertEquals(1, $results[0]->test_int);
701
        self::assertEquals('foo', $results[0]->test_string);
702
        self::assertStringStartsWith('2010-01-01 10:10:10', $results[0]->test_datetime);
703
    }
704
705
    /**
706
     * @group DBAL-241
@@ 725-742 (lines=18) @@
722
    /**
723
     * @group DBAL-214
724
     */
725
    public function testSetFetchModeClassFetchAll()
726
    {
727
        $this->skipOci8AndMysqli();
728
        $this->setupFixture();
729
730
        $sql = "SELECT * FROM fetch_table";
731
        $stmt = $this->_conn->query($sql);
732
        $stmt->setFetchMode(\PDO::FETCH_CLASS, __NAMESPACE__ . '\\MyFetchClass');
733
734
        $results = $stmt->fetchAll();
735
736
        self::assertEquals(1, count($results));
737
        self::assertInstanceOf(__NAMESPACE__.'\\MyFetchClass', $results[0]);
738
739
        self::assertEquals(1, $results[0]->test_int);
740
        self::assertEquals('foo', $results[0]->test_string);
741
        self::assertStringStartsWith('2010-01-01 10:10:10', $results[0]->test_datetime);
742
    }
743
744
    /**
745
     * @group DBAL-214