@@ 270-281 (lines=12) @@ | ||
267 | self::assertInstanceOf(Limitation::class, $limitation); |
|
268 | ||
269 | if ($policy->module == 'content' && $policy->function == 'read') { |
|
270 | switch ($limitation->getIdentifier()) { |
|
271 | case Limitation::CONTENTTYPE: |
|
272 | self::assertEquals($limitation1->limitationValues, $limitation->limitationValues); |
|
273 | break; |
|
274 | ||
275 | case Limitation::SECTION: |
|
276 | self::assertEquals($limitation2->limitationValues, $limitation->limitationValues); |
|
277 | break; |
|
278 | ||
279 | default: |
|
280 | self::fail('Created role contains limitations not defined with create struct'); |
|
281 | } |
|
282 | } elseif ($policy->module == 'content' && $policy->function == 'edit') { |
|
283 | switch ($limitation->getIdentifier()) { |
|
284 | case Limitation::OWNER: |
|
@@ 283-294 (lines=12) @@ | ||
280 | self::fail('Created role contains limitations not defined with create struct'); |
|
281 | } |
|
282 | } elseif ($policy->module == 'content' && $policy->function == 'edit') { |
|
283 | switch ($limitation->getIdentifier()) { |
|
284 | case Limitation::OWNER: |
|
285 | self::assertEquals($limitation3->limitationValues, $limitation->limitationValues); |
|
286 | break; |
|
287 | ||
288 | case Limitation::USERGROUP: |
|
289 | self::assertEquals($limitation4->limitationValues, $limitation->limitationValues); |
|
290 | break; |
|
291 | ||
292 | default: |
|
293 | self::fail('Created role contains limitations not defined with create struct'); |
|
294 | } |
|
295 | } else { |
|
296 | self::fail('Created role contains policy not defined with create struct'); |
|
297 | } |