@@ -20,33 +20,33 @@ public function test_get_unexisting_scope()
20
20
$ repo ->limitClientsToScopes (true );
21
21
$ repo ->limitScopesToGrants (true );
22
22
23
- $ result = $ repo ->get ('scope3 ' , 'grant3 ' );
23
+ $ result = $ repo ->get ('scope3 ' , 'grant3 ' , ' client3id ' );
24
24
25
25
$ this ->assertTrue ($ repo ->areClientsLimitedToScopes ());
26
26
$ this ->assertTrue ($ repo ->areScopesLimitedToGrants ());
27
27
$ this ->assertNull ($ result );
28
28
}
29
29
30
- /* public function test_get_scope_with_grant ()
30
+ public function test_get_scope_with_client_only ()
31
31
{
32
32
$ repo = $ this ->getScopeRepository ();
33
33
$ repo ->limitClientsToScopes (true );
34
- $repo->limitScopesToGrants(true);
35
34
36
- $result = $repo->get('scope1', 'grant1 ');
35
+ $ result = $ repo ->get ('scope1 ' , null , ' client1id ' );
37
36
38
- $this->resultAssertions ($result);
39
- }*/
37
+ $ this ->assertIsScope ($ result );
38
+ }
40
39
41
- /* public function test_get_scope_with_client_only ()
40
+ public function test_get_scope_with_invalid_client_only ()
42
41
{
43
- $repo = new FluentScope ();
42
+ $ repo = $ this -> getScopeRepository ();
44
43
$ repo ->limitClientsToScopes (true );
45
44
46
- $result = $repo->get('scope1', 'client1id ');
45
+ $ result = $ repo ->get ('scope1 ' , null , ' invalidclientid ' );
47
46
48
- $this->assertIsScope($result);
49
- }*/
47
+ $ this ->assertTrue ($ repo ->areClientsLimitedToScopes ());
48
+ $ this ->assertNull ($ result );
49
+ }
50
50
51
51
public function test_get_scope_with_grant_only ()
52
52
{
@@ -58,6 +58,30 @@ public function test_get_scope_with_grant_only()
58
58
$ this ->assertIsScope ($ result );
59
59
}
60
60
61
+ public function test_get_scope_with_invalid_grant_only ()
62
+ {
63
+ $ repo = $ this ->getScopeRepository ();
64
+ $ repo ->limitScopesToGrants (true );
65
+
66
+ $ result = $ repo ->get ('scope1 ' , 'invalidgrant ' );
67
+
68
+ $ this ->assertTrue ($ repo ->areScopesLimitedToGrants ());
69
+ $ this ->assertNull ($ result );
70
+ }
71
+
72
+ public function test_get_scope_with_client_and_grant ()
73
+ {
74
+ $ repo = $ this ->getScopeRepository ();
75
+ $ repo ->limitClientsToScopes (true );
76
+ $ repo ->limitScopesToGrants (true );
77
+
78
+ $ result = $ repo ->get ('scope1 ' , 'grant1 ' , 'client1id ' );
79
+
80
+ $ this ->assertTrue ($ repo ->areClientsLimitedToScopes ());
81
+ $ this ->assertTrue ($ repo ->areScopesLimitedToGrants ());
82
+ $ this ->assertIsScope ($ result );
83
+ }
84
+
61
85
public function test_get_scope ()
62
86
{
63
87
$ repo = $ this ->getScopeRepository ();
0 commit comments