faker = \Faker\Factory::create(); Model::reguard(); $this->makeTestData(); } public function testUserList() { $response = $this->withHeaders([ 'X-API-SECRET' => config('ninja.api_secret'), 'X-API-TOKEN' => $this->token, ])->get('/api/v1/users'); $response->assertStatus(200); } public function testUserStore() { $data = [ 'first_name' => 'hey', 'last_name' => 'you', 'email' => 'bob@good.ole.boys.com', 'company_user' => [ 'is_admin' => false, 'is_owner' => false, 'permissions' => 'create_client,create_invoice' ], ]; $response = $this->withHeaders([ 'X-API-SECRET' => config('ninja.api_secret'), 'X-API-TOKEN' => $this->token, ])->post('/api/v1/users?include=company_user', $data); $response->assertStatus(200); $arr = $response->json(); } }