@@ 32-40 (lines=9) @@ | ||
29 | return parent::setUp(); // TODO: Change the autogenerated stub |
|
30 | } |
|
31 | ||
32 | public function testServiceScopes() |
|
33 | { |
|
34 | $obj = $this->objFromFixture(Member::class, 'member1'); |
|
35 | ||
36 | $service = new ScopeService(); |
|
37 | ||
38 | $this->assertTrue($service->hasScope('scope1', $obj), 'Member should have the scope via groups'); |
|
39 | $this->assertFalse($service->hasScope('scope2', $obj), 'Member should not have scope2'); |
|
40 | } |
|
41 | ||
42 | public function testEntityScopes() |
|
43 | { |
|
@@ 42-50 (lines=9) @@ | ||
39 | $this->assertFalse($service->hasScope('scope2', $obj), 'Member should not have scope2'); |
|
40 | } |
|
41 | ||
42 | public function testEntityScopes() |
|
43 | { |
|
44 | $member = $this->objFromFixture(Member::class, 'member1'); |
|
45 | ||
46 | $entity = new UserEntity($member); |
|
47 | ||
48 | $this->assertTrue($entity->hasScope('scope1'), 'Member should have scope1'); |
|
49 | $this->assertFalse($entity->hasScope('scope2'), 'Member should not have scope2'); |
|
50 | } |
|
51 | ||
52 | } |
@@ 27-34 (lines=8) @@ | ||
24 | parent::setUp(); |
|
25 | } |
|
26 | ||
27 | public function testHasScope() |
|
28 | { |
|
29 | $service = new ScopeService(); |
|
30 | $member = $this->objFromFixture(Member::class, 'member1'); |
|
31 | ||
32 | $this->assertTrue($service->hasScope('scope1', $member, 'Member should have scope1')); |
|
33 | $this->assertFalse($service->hasScope('scope2', $member, 'Member should have scope2')); |
|
34 | } |
|
35 | } |