faker = \Faker\Factory::create(); $this->withoutMiddleware( ThrottleRequests::class ); $this->withoutExceptionHandling(); $this->makeTestData(); } public function testActivityCSVExport() { $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/activities', $data) ->assertStatus(200); } public function testActivityCSVExportJson() { $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/activities?output=json', $data) ->assertStatus(200); } public function testUserSalesReportApiRoute() { $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/user_sales_report', $data) ->assertStatus(200); } public function testTaxSummaryReportApiRoute() { $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/tax_summary_report', $data) ->assertStatus(200); } public function testClientSalesReportApiRoute() { $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/client_sales_report', $data) ->assertStatus(200); } public function testArDetailReportApiRoute() { $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/ar_detail_report', $data) ->assertStatus(200); } public function testArSummaryReportApiRoute() { $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/ar_summary_report', $data) ->assertStatus(200); } public function testClientBalanceReportApiRoute() { $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/client_balance_report', $data) ->assertStatus(200); } }