'setting'], ['value' => json_encode([ 'title' => 'Portal', 'brand_color' => '#EF6824', 'bot_token' => 'secret-bot-token', 'inet_api_key' => 'secret-inet-key', 'telegram_group_id' => '-100123', 'admin_email' => 'admin@example.com', ])]); $client = $this->withHeaders(['x-access-token' => $this->buildClientAccessToken()]) ->getJson('/v1/setting') ->assertOk() ->assertJsonPath('data.title', 'Portal') ->assertJsonPath('data.brand_color', '#EF6824'); $admin = $this->getJson('/api/v1/settings/public')->assertOk(); foreach ([$client, $admin] as $response) { $body = $response->getContent(); $this->assertStringNotContainsString('secret-bot-token', $body); $this->assertStringNotContainsString('secret-inet-key', $body); $this->assertStringNotContainsString('-100123', $body); $this->assertStringNotContainsString('admin@example.com', $body); } } }