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 @@ -48,6 +48,14 @@ public function __get(string $name)
48
48
return $ this ->getService ($ name );
49
49
}
50
50
51
+ /**
52
+ * Magic method to retrieve a service by name.
53
+ */
54
+ public function __call (string $ name , array $ arguments )
55
+ {
56
+ return $ this ->getService ($ name );
57
+ }
58
+
51
59
/**
52
60
* Attach the given API service to the client.
53
61
*/
Original file line number Diff line number Diff line change 20
20
21
21
});
22
22
23
- test ('service is created when required ' , function () {
23
+ test ('service is created when required through property ' , function () {
24
24
$ resend = Resend::client ('foo ' );
25
25
26
26
expect ($ resend ->apiKeys )
27
27
->toBeInstanceOf (ApiKey::class);
28
28
});
29
+
30
+ test ('sevice is created when required through method ' , function () {
31
+ $ resend = Resend::client ('foo ' );
32
+
33
+ expect ($ resend ->apiKeys ())
34
+ ->toBeInstanceOf (ApiKey::class);
35
+ });
You can’t perform that action at this time.
0 commit comments