File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 66use Laravel \Passport \PersonalAccessClient ;
77use Laravel \Passport \Token ;
88use PHPUnit \Framework \TestCase ;
9+ use Laravel \Passport \ClientRepository ;
910
1011class PassportTest extends TestCase
1112{
@@ -44,6 +45,17 @@ public function test_personal_access_client_instance_can_be_created()
4445 $ this ->assertInstanceOf (Passport::personalAccessClientModel (), $ client );
4546 }
4647
48+ /**
49+ * @expectedException RuntimeException
50+ */
51+ public function test_missing_personal_access_client_is_reported ()
52+ {
53+ Passport::usePersonalAccessClientModel ('PersonalAccessClientStub ' );
54+
55+ $ clientRepository = new ClientRepository ;
56+ $ clientRepository ->personalAccessClient ();
57+ }
58+
4759 public function test_token_instance_can_be_created ()
4860 {
4961 $ token = Passport::token ();
@@ -52,3 +64,11 @@ public function test_token_instance_can_be_created()
5264 $ this ->assertInstanceOf (Passport::tokenModel (), $ token );
5365 }
5466}
67+
68+ class PersonalAccessClientStub
69+ {
70+ public function exists ()
71+ {
72+ return false ;
73+ }
74+ }
You can’t perform that action at this time.
0 commit comments