8000 minor #58021 [Serializer] remove custom CSV escape character from tes… · core23/symfony@9348c49 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9348c49

Browse files
minor symfony#58021 [Serializer] remove custom CSV escape character from tests (xabbuh)
This PR was merged into the 5.4 branch. Discussion ---------- [Serializer] remove custom CSV escape character from tests | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT using custom escape character will be deprecated from PHP 8.4 Commits ------- 8c6bbce remove custom CSV escape character from tests
2 parents a0b0dff + 8c6bbce commit 9348c49

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Symfony/Component/Serializer/Tests/Encoder/CsvEncoderTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public function testEncodeCustomSettings()
158158
$this->encoder = new CsvEncoder([
159159
CsvEncoder::DELIMITER_KEY => ';',
160160
CsvEncoder::ENCLOSURE_KEY => "'",
161-
CsvEncoder::ESCAPE_CHAR_KEY => '|',
161+
CsvEncoder::ESCAPE_CHAR_KEY => \PHP_VERSION_ID < 70400 ? '|' : '',
162162
CsvEncoder::KEY_SEPARATOR_KEY => '-',
163163
]);
164164

@@ -184,7 +184,7 @@ public function testEncodeCustomSettingsPassedInContext()
184184
, $this->encoder->encode($value, 'csv', [
185185
CsvEncoder::DELIMITER_KEY => ';',
186186
CsvEncoder::ENCLOSURE_KEY => "'",
187-
CsvEncoder::ESCAPE_CHAR_KEY => '|',
187+
CsvEncoder::ESCAPE_CHAR_KEY => \PHP_VERSION_ID < 70400 ? '|' : '',
188188
CsvEncoder::KEY_SEPARATOR_KEY => '-',
189189
]));
190190
}
@@ -194,7 +194,7 @@ public function testEncodeCustomSettingsPassedInConstructor()
194194
$encoder = new CsvEncoder([
195195
CsvEncoder::DELIMITER_KEY => ';',
196196
CsvEncoder::ENCLOSURE_KEY => "'",
197-
CsvEncoder::ESCAPE_CHAR_KEY => '|',
197+
CsvEncoder::ESCAPE_CHAR_KEY => \PHP_VERSION_ID < 70400 ? '|' : '',
198198
CsvEncoder::KEY_SEPARATOR_KEY => '-',
199199
]);
200200
$value = ['a' => 'he\'llo', 'c' => ['d' => 'foo']];
@@ -583,7 +583,7 @@ public function testDecodeCustomSettings()
583583
$this->encoder = new CsvEncoder([
584584
CsvEncoder::DELIMITER_KEY => ';',
585585
CsvEncoder::ENCLOSURE_KEY => "'",
586-
CsvEncoder::ESCAPE_CHAR_KEY => '|',
586+
CsvEncoder::ESCAPE_CHAR_KEY => \PHP_VERSION_ID < 70400 ? '|' : '',
587587
CsvEncoder::KEY_SEPARATOR_KEY => '-',
588588
]);
589589

@@ -605,7 +605,7 @@ public function testDecodeCustomSettingsPassedInContext()
605605
, 'csv', [
606606
CsvEncoder::DELIMITER_KEY => ';',
607607
CsvEncoder::ENCLOSURE_KEY => "'",
608-
CsvEncoder::ESCAPE_CHAR_KEY => '|',
608+
CsvEncoder::ESCAPE_CHAR_KEY => \PHP_VERSION_ID < 70400 ? '|' : '',
609609
CsvEncoder::KEY_SEPARATOR_KEY => '-',
610610
]));
611611
}
@@ -615,7 +615,7 @@ public function testDecodeCustomSettingsPassedInConstructor()
615615
$encoder = new CsvEncoder([
616616
CsvEncoder::DELIMITER_KEY => ';',
617617
CsvEncoder::ENCLOSURE_KEY => "'",
618-
CsvEncoder::ESCAPE_CHAR_KEY => '|',
618+
CsvEncoder::ESCAPE_CHAR_KEY => \PHP_VERSION_ID < 70400 ? '|' : '',
619619
CsvEncoder::KEY_SEPARATOR_KEY => '-',
620620
CsvEncoder::AS_COLLECTION_KEY => true, // Can be removed in 5.0
621621
]);

0 commit comments

Comments
 (0)
0