File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,6 @@ class Brands
88{
99 public function get ()
1010 {
11- return LaravelSendy::get ('/api/brands/get-brands.php ' );
11+ return LaravelSendy::post ('/api/brands/get-brands.php ' );
1212 }
1313}
Original file line number Diff line number Diff line change 11<?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