Code Duplication    Length = 21-24 lines in 2 locations

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

@@ 1006-1026 (lines=21) @@
1003
    /**
1004
     * @group DDC-3056
1005
     */
1006
    public function testFindByNullValueInInCondition()
1007
    {
1008
        $user1 = new CmsUser();
1009
        $user2 = new CmsUser();
1010
1011
        $user1->username = 'ocramius';
1012
        $user1->name = 'Marco';
1013
        $user2->status = null;
1014
        $user2->username = 'deeky666';
1015
        $user2->name = 'Steve';
1016
        $user2->status = 'dbal maintainer';
1017
1018
        $this->em->persist($user1);
1019
        $this->em->persist($user2);
1020
        $this->em->flush();
1021
1022
        $users = $this->em->getRepository(CmsUser::class)->findBy(['status' => [null]]);
1023
1024
        self::assertCount(1, $users);
1025
        self::assertSame($user1, reset($users));
1026
    }
1027
1028
    /**
1029
     * @group DDC-3056
@@ 1031-1054 (lines=24) @@
1028
    /**
1029
     * @group DDC-3056
1030
     */
1031
    public function testFindByNullValueInMultipleInCriteriaValues()
1032
    {
1033
        $user1 = new CmsUser();
1034
        $user2 = new CmsUser();
1035
1036
        $user1->username = 'ocramius';
1037
        $user1->name = 'Marco';
1038
        $user2->status = null;
1039
        $user2->username = 'deeky666';
1040
        $user2->name = 'Steve';
1041
        $user2->status = 'dbal maintainer';
1042
1043
        $this->em->persist($user1);
1044
        $this->em->persist($user2);
1045
        $this->em->flush();
1046
1047
        $users = $this
1048
            ->em
1049
            ->getRepository(CmsUser::class)
1050
            ->findBy(['status' => ['foo', null]]);
1051
1052
        self::assertCount(1, $users);
1053
        self::assertSame($user1, reset($users));
1054
    }
1055
1056
    /**
1057
     * @group DDC-3056