File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ public function isFreemium(): bool
114
114
*/
115
115
public function hasOfflineAccess (): bool
116
116
{
117
- return ! $ this ->getToken ()->isNull ();
117
+ return ! $ this ->getToken ()->isNull () && ! empty ( $ this -> password ) ;
118
118
}
119
119
120
120
/**
Original file line number Diff line number Diff line change @@ -35,6 +35,21 @@ public function testModel(): void
35
35
$ this ->assertInstanceOf (IApiHelper::class, $ shop ->apiHelper ());
36
36
}
37
37
38
+ public function testOfflineToken (): void
39
+ {
40
+ // No token
41
+ $ shop = factory ($ this ->model )->create ([
42
+ 'password ' => '' ,
43
+ ]);
44
+ $ this ->assertFalse ($ shop ->hasOfflineAccess ());
45
+
46
+ // With token
47
+ $ shop ->password = 'abc123 ' ;
48
+ $ shop ->save ();
49
+ $ shop ->refresh ();
50
+ $ this ->assertTrue ($ shop ->hasOfflineAccess ());
51
+ }
52
+
38
53
public function testNamespacingAndFreemium ()
39
54
{
40
55
$ this ->app ['config ' ]->set ('shopify-app.billing_freemium_enabled ' , true );
You can’t perform that action at this time.
0 commit comments