Code Duplication    Length = 27-27 lines in 2 locations

tests/Doctrine/Tests/ORM/Functional/NewOperatorTest.php 2 locations

@@ 211-237 (lines=27) @@
208
        $this->assertInstanceOf(CmsUserDTO::class, $result[2]);
209
    }
210
211
    public function testShouldSupportFromEntityNamespaceAlias()
212
    {
213
        $dql = "
214
            SELECT
215
                new CmsUserDTO(u.name, e.email, a.city)
216
            FROM
217
                cms:CmsUser u
218
            JOIN
219
                u.email e
220
            JOIN
221
                u.address a
222
            ORDER BY
223
                u.name";
224
225
226
        $this->_em->getConfiguration()
227
            ->addEntityNamespace('cms', 'Doctrine\Tests\Models\CMS');
228
229
        $query  = $this->_em->createQuery($dql);
230
        $result = $query->getResult();
231
232
        $this->assertCount(3, $result);
233
234
        $this->assertInstanceOf(CmsUserDTO::class, $result[0]);
235
        $this->assertInstanceOf(CmsUserDTO::class, $result[1]);
236
        $this->assertInstanceOf(CmsUserDTO::class, $result[2]);
237
    }
238
239
    public function testShouldSupportValueObjectNamespaceAlias()
240
    {
@@ 239-265 (lines=27) @@
236
        $this->assertInstanceOf(CmsUserDTO::class, $result[2]);
237
    }
238
239
    public function testShouldSupportValueObjectNamespaceAlias()
240
    {
241
        $dql = "
242
            SELECT
243
                new cms:CmsUserDTO(u.name, e.email, a.city)
244
            FROM
245
                cms:CmsUser u
246
            JOIN
247
                u.email e
248
            JOIN
249
                u.address a
250
            ORDER BY
251
                u.name";
252
253
254
        $this->_em->getConfiguration()
255
            ->addEntityNamespace('cms', 'Doctrine\Tests\Models\CMS');
256
257
        $query  = $this->_em->createQuery($dql);
258
        $result = $query->getResult();
259
260
        $this->assertCount(3, $result);
261
262
        $this->assertInstanceOf(CmsUserDTO::class, $result[0]);
263
        $this->assertInstanceOf(CmsUserDTO::class, $result[1]);
264
        $this->assertInstanceOf(CmsUserDTO::class, $result[2]);
265
    }
266
267
    public function testShouldSupportLiteralExpression()
268
    {