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