From d8f895e187696d6aa9fea6206443d7b0ffcaba01 Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Sun, 22 Sep 2019 23:53:04 +0200 Subject: [PATCH] Revert yield change --- .../DependencyInjection/ConfigurationTest.php | 91 ++++++++++--------- 1 file changed, 48 insertions(+), 43 deletions(-) diff --git a/test/DependencyInjection/ConfigurationTest.php b/test/DependencyInjection/ConfigurationTest.php index 21073fd5..8305c4b8 100644 --- a/test/DependencyInjection/ConfigurationTest.php +++ b/test/DependencyInjection/ConfigurationTest.php @@ -148,52 +148,57 @@ public function testInvalidValues(string $option, $value): void $this->processConfiguration($input); } - public function invalidValuesProvider(): \Generator + public function invalidValuesProvider(): array { - yield ['attach_stacktrace', 'string']; - yield ['before_breadcrumb', 'this is not a callable']; - yield ['before_breadcrumb', [$this, 'is not a callable']]; - yield ['before_breadcrumb', false]; - yield ['before_breadcrumb', -1]; - yield ['before_send', 'this is not a callable']; - yield ['before_send', [$this, 'is not a callable']]; - yield ['before_send', false]; - yield ['before_send', -1]; + $values = [ + ['attach_stacktrace', 'string'], + ['before_breadcrumb', 'this is not a callable'], + ['before_breadcrumb', [$this, 'is not a callable']], + ['before_breadcrumb', false], + ['before_breadcrumb', -1], + ['before_send', 'this is not a callable'], + ['before_send', [$this, 'is not a callable']], + ['before_send', false], + ['before_send', -1], + ['context_lines', -1], + ['context_lines', 99999], + ['context_lines', 'string'], + ['default_integrations', 'true'], + ['default_integrations', 1], + ['enable_compression', 'string'], + ['environment', ''], + ['error_types', []], + ['excluded_exceptions', 'some-string'], + ['http_proxy', []], + ['in_app_exclude', 'some/single/path'], + ['integrations', [1]], + ['integrations', 'a string'], + ['logger', []], + ['max_breadcrumbs', -1], + ['max_breadcrumbs', 'string'], + ['max_value_length', -1], + ['max_value_length', []], + ['prefixes', 'string'], + ['project_root', []], + ['release', []], + ['sample_rate', 1.1], + ['sample_rate', -1], + ['send_attempts', 1.5], + ['send_attempts', 0], + ['send_attempts', -1], + ['send_default_pii', 'false'], + ['server_name', []], + ['tags', 'invalid-unmapped-tag'], + ]; + if ($this->classSerializersAreSupported()) { - yield ['class_serializers', 'this is not a callable']; - yield ['class_serializers', [$this, 'is not a callable']]; - yield ['class_serializers', false]; - yield ['class_serializers', -1]; + $values[] = ['class_serializers', 'this is not a callable']; + $values[] = ['class_serializers', [$this, 'is not a callable']]; + $values[] = ['class_serializers', false]; + $values[] = ['class_serializers', -1]; } - yield ['context_lines', -1]; - yield ['context_lines', 99999]; - yield ['context_lines', 'string']; - yield ['default_integrations', 'true']; - yield ['default_integrations', 1]; - yield ['enable_compression', 'string']; - yield ['environment', '']; - yield ['error_types', []]; - yield ['excluded_exceptions', 'some-string']; - yield ['http_proxy', []]; - yield ['in_app_exclude', 'some/single/path']; - yield ['integrations', [1]]; - yield ['integrations', 'a string']; - yield ['logger', []]; - yield ['max_breadcrumbs', -1]; - yield ['max_breadcrumbs', 'string']; - yield ['max_value_length', -1]; - yield ['max_value_length', []]; - yield ['prefixes', 'string']; - yield ['project_root', []]; - yield ['release', []]; - yield ['sample_rate', 1.1]; - yield ['sample_rate', -1]; - yield ['send_attempts', 1.5]; - yield ['send_attempts', 0]; - yield ['send_attempts', -1]; - yield ['send_default_pii', 'false']; - yield ['server_name', []]; - yield ['tags', 'invalid-unmapped-tag']; + + return $values; } private function processConfiguration(array $values): array