|
12 | 12 |
|
13 | 13 | class ConfigurationTest extends BaseTestCase
|
14 | 14 | {
|
15 |
| - public const SUPPORTED_SENTRY_OPTIONS_COUNT = 23; |
16 |
| - |
17 | 15 | public function testDataProviderIsMappingTheRightNumberOfOptions(): void
|
18 | 16 | {
|
19 | 17 | $providerData = $this->optionValuesProvider();
|
@@ -150,52 +148,52 @@ public function testInvalidValues(string $option, $value): void
|
150 | 148 | $this->processConfiguration($input);
|
151 | 149 | }
|
152 | 150 |
|
153 |
| - public function invalidValuesProvider(): array |
| 151 | + public function invalidValuesProvider(): \Generator |
154 | 152 | {
|
155 |
| - return [ |
156 |
| - ['attach_stacktrace', 'string'], |
157 |
| - ['before_breadcrumb', 'this is not a callable'], |
158 |
| - ['before_breadcrumb', [$this, 'is not a callable']], |
159 |
| - ['before_breadcrumb', false], |
160 |
| - ['before_breadcrumb', -1], |
161 |
| - ['before_send', 'this is not a callable'], |
162 |
| - ['before_send', [$this, 'is not a callable']], |
163 |
| - ['before_send', false], |
164 |
| - ['before_send', -1], |
165 |
| - ['class_serializers', 'this is not a callable'], |
166 |
| - ['class_serializers', [$this, 'is not a callable']], |
167 |
| - ['class_serializers', false], |
168 |
| - ['class_serializers', -1], |
169 |
| - ['context_lines', -1], |
170 |
| - ['context_lines', 99999], |
171 |
| - ['context_lines', 'string'], |
172 |
| - ['default_integrations', 'true'], |
173 |
| - ['default_integrations', 1], |
174 |
| - ['enable_compression', 'string'], |
175 |
| - ['environment', ''], |
176 |
| - ['error_types', []], |
177 |
| - ['excluded_exceptions', 'some-string'], |
178 |
| - ['http_proxy', []], |
179 |
| - ['in_app_exclude', 'some/single/path'], |
180 |
| - ['integrations', [1]], |
181 |
| - ['integrations', 'a string'], |
182 |
| - ['logger', []], |
183 |
| - ['max_breadcrumbs', -1], |
184 |
| - ['max_breadcrumbs', 'string'], |
185 |
| - ['max_value_length', -1], |
186 |
| - ['max_value_length', []], |
187 |
| - ['prefixes', 'string'], |
188 |
| - ['project_root', []], |
189 |
| - ['release', []], |
190 |
| - ['sample_rate', 1.1], |
191 |
| - ['sample_rate', -1], |
192 |
| - ['send_attempts', 1.5], |
193 |
| - ['send_attempts', 0], |
194 |
| - ['send_attempts', -1], |
195 |
| - ['send_default_pii', 'false'], |
196 |
| - ['server_name', []], |
197 |
| - ['tags', 'invalid-unmapped-tag'], |
198 |
| - ]; |
| 153 | + yield ['attach_stacktrace', 'string']; |
| 154 | + yield ['before_breadcrumb', 'this is not a callable']; |
| 155 | + yield ['before_breadcrumb', [$this, 'is not a callable']]; |
| 156 | + yield ['before_breadcrumb', false]; |
| 157 | + yield ['before_breadcrumb', -1]; |
| 158 | + yield ['before_send', 'this is not a callable']; |
| 159 | + yield ['before_send', [$this, 'is not a callable']]; |
| 160 | + yield ['before_send', false]; |
| 161 | + yield ['before_send', -1]; |
| 162 | + if ($this->classSerializersAreSupported()) { |
| 163 | + yield ['class_serializers', 'this is not a callable']; |
| 164 | + yield ['class_serializers', [$this, 'is not a callable']]; |
| 165 | + yield ['class_serializers', false]; |
| 166 | + yield ['class_serializers', -1]; |
| 167 | + } |
| 168 | + yield ['context_lines', -1]; |
| 169 | + yield ['context_lines', 99999]; |
| 170 | + yield ['context_lines', 'string']; |
| 171 | + yield ['default_integrations', 'true']; |
| 172 | + yield ['default_integrations', 1]; |
| 173 | + yield ['enable_compression', 'string']; |
| 174 | + yield ['environment', '']; |
| 175 | + yield ['error_types', []]; |
| 176 | + yield ['excluded_exceptions', 'some-string']; |
| 177 | + yield ['http_proxy', []]; |
| 178 | + yield ['in_app_exclude', 'some/single/path']; |
| 179 | + yield ['integrations', [1]]; |
| 180 | + yield ['integrations', 'a string']; |
| 181 | + yield ['logger', []]; |
| 182 | + yield ['max_breadcrumbs', -1]; |
| 183 | + yield ['max_breadcrumbs', 'string']; |
| 184 | + yield ['max_value_length', -1]; |
| 185 | + yield ['max_value_length', []]; |
| 186 | + yield ['prefixes', 'string']; |
| 187 | + yield ['project_root', []]; |
| 188 | + yield ['release', []]; |
| 189 | + yield ['sample_rate', 1.1]; |
| 190 | + yield ['sample_rate', -1]; |
| 191 | + yield ['send_attempts', 1.5]; |
| 192 | + yield ['send_attempts', 0]; |
| 193 | + yield ['send_attempts', -1]; |
| 194 | + yield ['send_default_pii', 'false']; |
| 195 | + yield ['server_name', []]; |
| 196 | + yield ['tags', 'invalid-unmapped-tag']; |
199 | 197 | }
|
200 | 198 |
|
201 | 199 | private function processConfiguration(array $values): array
|
|
0 commit comments