File tree 2 files changed +26
-1
lines changed
2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,6 @@ class Brands
8
8
{
9
9
public function get ()
10
10
{
11
- return LaravelSendy::get ('/api/brands/get-brands.php ' );
11
+ return LaravelSendy::post ('/api/brands/get-brands.php ' );
12
12
}
13
13
}
Original file line number Diff line number Diff line change 1
1
<?php
2
+
3
+ use Coderflex \LaravelSendy \Facades \LaravelSendy ;
4
+ use Illuminate \Support \Facades \Http ;
5
+
6
+ beforeEach (function () {
7
+ config ([
8
+ 'laravel-sendy.api_key ' => 'test_api_key ' ,
9
+ 'laravel-sendy.api_url ' => 'https://sendy.test/ ' ,
10
+ ]);
11
+ });
12
+
13
+ it ('can get subscriber brands ' , function () {
14
+ Http::fake ([
15
+ 'https://sendy.test/api/brands/get-brands.php ' => Http::response ([123 => 'Brand Name ' ], 200 ),
16
+ ]);
17
+
18
+ $ response = LaravelSendy::brands ()->get ();
19
+
20
+ expect ($ response ->json ())->toBe ([123 => 'Brand Name ' ]);
21
+
22
+ Http::assertSent (function ($ request ) {
23
+ return $ request ->url () === 'https://sendy.test/api/brands/get-brands.php ' &&
24
+ $ request ['api_key ' ] === 'test_api_key ' ;
25
+ });
26
+ });
You can’t perform that action at this time.
0 commit comments