Code Duplication    Length = 18-21 lines in 2 locations

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

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