@@ 139-150 (lines=12) @@ | ||
136 | $this->assertEquals('group2', $object->getName()); |
|
137 | } |
|
138 | ||
139 | public function testValidateGroupWithoutRole() |
|
140 | { |
|
141 | $group = new Group('test'); |
|
142 | ||
143 | $validator = Validation::createValidatorBuilder() |
|
144 | ->enableAnnotationMapping() |
|
145 | ->getValidator(); |
|
146 | ||
147 | $violations = $validator->validate($group); |
|
148 | ||
149 | $this->assertCount(1, $violations); |
|
150 | } |
|
151 | ||
152 | public function testValidateGroupWithRole() |
|
153 | { |
|
@@ 152-164 (lines=13) @@ | ||
149 | $this->assertCount(1, $violations); |
|
150 | } |
|
151 | ||
152 | public function testValidateGroupWithRole() |
|
153 | { |
|
154 | $group = new Group('test'); |
|
155 | $group->addRole(new Role('role')); |
|
156 | ||
157 | $validator = Validation::createValidatorBuilder() |
|
158 | ->enableAnnotationMapping() |
|
159 | ->getValidator(); |
|
160 | ||
161 | $violations = $validator->validate($group); |
|
162 | ||
163 | $this->assertCount(0, $violations); |
|
164 | } |
|
165 | ||
166 | /** |
|
167 | * @param string $name |