File tree Expand file tree Collapse file tree 1 file changed +15
-38
lines changed Expand file tree Collapse file tree 1 file changed +15
-38
lines changed Original file line number Diff line number Diff line change 8686 ]);
8787});
8888
89- //it('can make fake http request to get list of banks', function () {
90- // $body = file_get_contents(__DIR__.'/Fixtures/banks.json');
91- //
92- // Http::fake([
93- // 'https://api.paystack.co/bank' => Http::response($body, 200),
94- // ]);
95- //
96- // // assert if there is a bank with name "Abbey Mortgage Bank" in the list of banks
97- //// $body =
98- //
99- //
100- //// expect(json_decode($body, true)['data'])
101- //// ->toBeArray()
102- ////// ->dd()
103- //// ->toContain(fn ($bank) => $bank['name'] === 'Abbey Mortgage Bank');
104- //
105- //// expect(
106- //// collect(json_decode($body, true)['data'])
107- //// ->where('name', 'Abbey Mortgage Bank')
108- //// ->isNotEmpty()
109- //// )
110- //// ->toBeTrue();
111- //
112- //
113- //
114- //// expect($body)
115- //// ->toBeString()
116- //// ->toContain('Abbey Mortgage Bank');
117- //
118- //// expect(json_decode($body, true))
119- //// ->toBeArray()
120- //// ->toHaveKeys([
121- //// 'status',
122- //// 'message',
123- //// 'data',
124- //// ])
125- //// ->toContain('data');
126- //});
89+ it ('can make fake http request to get list of banks ' , function () {
90+ $ body = file_get_contents (__DIR__ . '/../Fixtures/banks.json ' );
91+
92+ Http::fake ([
93+ 'https://api.paystack.co/bank ' => Http::response ($ body ),
94+ ]);
95+
96+ expect (json_decode ($ body , true ))
97+ ->toBeArray ()
98+ ->toHaveKeys ([
99+ 'status ' ,
100+ 'message ' ,
101+ 'data ' ,
102+ ]);
103+ });
You can’t perform that action at this time.
0 commit comments