| @@ 1042-1062 (lines=21) @@ | ||
| 1039 | /** |
|
| 1040 | * @group DDC-3056 |
|
| 1041 | */ |
|
| 1042 | public function testFindByNullValueInInCondition() |
|
| 1043 | { |
|
| 1044 | $user1 = new CmsUser(); |
|
| 1045 | $user2 = new CmsUser(); |
|
| 1046 | ||
| 1047 | $user1->username = 'ocramius'; |
|
| 1048 | $user1->name = 'Marco'; |
|
| 1049 | $user2->status = null; |
|
| 1050 | $user2->username = 'deeky666'; |
|
| 1051 | $user2->name = 'Steve'; |
|
| 1052 | $user2->status = 'dbal maintainer'; |
|
| 1053 | ||
| 1054 | $this->_em->persist($user1); |
|
| 1055 | $this->_em->persist($user2); |
|
| 1056 | $this->_em->flush(); |
|
| 1057 | ||
| 1058 | $users = $this->_em->getRepository(CmsUser::class)->findBy(['status' => [null]]); |
|
| 1059 | ||
| 1060 | $this->assertCount(1, $users); |
|
| 1061 | $this->assertSame($user1, reset($users)); |
|
| 1062 | } |
|
| 1063 | ||
| 1064 | /** |
|
| 1065 | * @group DDC-3056 |
|
| @@ 1067-1090 (lines=24) @@ | ||
| 1064 | /** |
|
| 1065 | * @group DDC-3056 |
|
| 1066 | */ |
|
| 1067 | public function testFindByNullValueInMultipleInCriteriaValues() |
|
| 1068 | { |
|
| 1069 | $user1 = new CmsUser(); |
|
| 1070 | $user2 = new CmsUser(); |
|
| 1071 | ||
| 1072 | $user1->username = 'ocramius'; |
|
| 1073 | $user1->name = 'Marco'; |
|
| 1074 | $user2->status = null; |
|
| 1075 | $user2->username = 'deeky666'; |
|
| 1076 | $user2->name = 'Steve'; |
|
| 1077 | $user2->status = 'dbal maintainer'; |
|
| 1078 | ||
| 1079 | $this->_em->persist($user1); |
|
| 1080 | $this->_em->persist($user2); |
|
| 1081 | $this->_em->flush(); |
|
| 1082 | ||
| 1083 | $users = $this |
|
| 1084 | ->_em |
|
| 1085 | ->getRepository(CmsUser::class) |
|
| 1086 | ->findBy(['status' => ['foo', null]]); |
|
| 1087 | ||
| 1088 | $this->assertCount(1, $users); |
|
| 1089 | $this->assertSame($user1, reset($users)); |
|
| 1090 | } |
|
| 1091 | ||
| 1092 | /** |
|
| 1093 | * @group DDC-3056 |
|