Code Duplication    Length = 12-13 lines in 2 locations

src/Oro/Bundle/ApiBundle/Tests/Unit/Collection/CriteriaTest.php 2 locations

@@ 74-85 (lines=12) @@
71
    /**
72
     * @dataProvider joinTypeDataProvider
73
     */
74
    public function testAddJoin($joinType, $addMethodName)
75
    {
76
        $this->criteria->{$addMethodName}('products', '{root}.products');
77
78
        $expectedJoin = new Join($joinType, '{root}.products');
79
        $this->assertTrue($this->criteria->hasJoin('products'));
80
        $this->assertEquals($expectedJoin, $this->criteria->getJoin('products'));
81
        $this->assertEquals(['products' => $expectedJoin], $this->criteria->getJoins());
82
        $this->assertQuery(
83
            'SELECT e FROM Test:User e ' . $joinType . ' JOIN e.products a1'
84
        );
85
    }
86
87
    /**
88
     * @dataProvider joinTypeDataProvider
@@ 255-267 (lines=13) @@
252
    /**
253
     * @dataProvider joinTypeDataProvider
254
     */
255
    public function testAddSameJoinTwice($joinType, $addMethodName)
256
    {
257
        $this->criteria->{$addMethodName}('products', '{root}.products');
258
        $this->criteria->{$addMethodName}('products', '{root}.products');
259
260
        $expectedJoin = new Join($joinType, '{root}.products');
261
        $this->assertTrue($this->criteria->hasJoin('products'));
262
        $this->assertEquals($expectedJoin, $this->criteria->getJoin('products'));
263
        $this->assertEquals(['products' => $expectedJoin], $this->criteria->getJoins());
264
        $this->assertQuery(
265
            'SELECT e FROM Test:User e ' . $joinType . ' JOIN e.products a1'
266
        );
267
    }
268
269
    public function testAddInnerJoinAndThenLeftJoinForSameJoinStatement()
270
    {