faker = \Faker\Factory::create(); $this->withoutMiddleware( ThrottleRequests::class ); $this->withoutExceptionHandling(); $this->makeTestData(); } public function testCreditExportPreview() { $data = [ 'send_email' => false, 'date_range' => 'all', 'report_keys' => [], ]; $p = (new PreviewReport($this->company, $data, CreditExport::class, '123'))->handle(); $this->assertNull($p); } public function testCreditPreview() { $data = [ 'send_email' => false, 'date_range' => 'all', 'report_keys' => [], ]; $response = $this->withHeaders([ 'X-API-SECRET' => config('ninja.api_secret'), 'X-API-TOKEN' => $this->token, ])->postJson('/api/v1/reports/credits?output=json', $data) ->assertStatus(200); } }