Skip to content

Commit

Permalink
remove custom CSV escape character from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Aug 16, 2024
1 parent 1e538a6 commit b4ad9e6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Tests/Encoder/CsvEncoderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public function testEncodeCustomSettings()
$this->encoder = new CsvEncoder([
CsvEncoder::DELIMITER_KEY => ';',
CsvEncoder::ENCLOSURE_KEY => "'",
CsvEncoder::ESCAPE_CHAR_KEY => '|',
CsvEncoder::ESCAPE_CHAR_KEY => \PHP_VERSION_ID < 70400 ? '|' : '',
CsvEncoder::KEY_SEPARATOR_KEY => '-',
]);

Expand All @@ -184,7 +184,7 @@ public function testEncodeCustomSettingsPassedInContext()
, $this->encoder->encode($value, 'csv', [
CsvEncoder::DELIMITER_KEY => ';',
CsvEncoder::ENCLOSURE_KEY => "'",
CsvEncoder::ESCAPE_CHAR_KEY => '|',
CsvEncoder::ESCAPE_CHAR_KEY => \PHP_VERSION_ID < 70400 ? '|' : '',
CsvEncoder::KEY_SEPARATOR_KEY => '-',
]));
}
Expand All @@ -194,7 +194,7 @@ public function testEncodeCustomSettingsPassedInConstructor()
$encoder = new CsvEncoder([
CsvEncoder::DELIMITER_KEY => ';',
CsvEncoder::ENCLOSURE_KEY => "'",
CsvEncoder::ESCAPE_CHAR_KEY => '|',
CsvEncoder::ESCAPE_CHAR_KEY => \PHP_VERSION_ID < 70400 ? '|' : '',
CsvEncoder::KEY_SEPARATOR_KEY => '-',
]);
$value = ['a' => 'he\'llo', 'c' => ['d' => 'foo']];
Expand Down Expand Up @@ -583,7 +583,7 @@ public function testDecodeCustomSettings()
$this->encoder = new CsvEncoder([
CsvEncoder::DELIMITER_KEY => ';',
CsvEncoder::ENCLOSURE_KEY => "'",
CsvEncoder::ESCAPE_CHAR_KEY => '|',
CsvEncoder::ESCAPE_CHAR_KEY => \PHP_VERSION_ID < 70400 ? '|' : '',
CsvEncoder::KEY_SEPARATOR_KEY => '-',
]);

Expand All @@ -605,7 +605,7 @@ public function testDecodeCustomSettingsPassedInContext()
, 'csv', [
CsvEncoder::DELIMITER_KEY => ';',
CsvEncoder::ENCLOSURE_KEY => "'",
CsvEncoder::ESCAPE_CHAR_KEY => '|',
CsvEncoder::ESCAPE_CHAR_KEY => \PHP_VERSION_ID < 70400 ? '|' : '',
CsvEncoder::KEY_SEPARATOR_KEY => '-',
]));
}
Expand All @@ -615,7 +615,7 @@ public function testDecodeCustomSettingsPassedInConstructor()
$encoder = new CsvEncoder([
CsvEncoder::DELIMITER_KEY => ';',
CsvEncoder::ENCLOSURE_KEY => "'",
CsvEncoder::ESCAPE_CHAR_KEY => '|',
CsvEncoder::ESCAPE_CHAR_KEY => \PHP_VERSION_ID < 70400 ? '|' : '',
CsvEncoder::KEY_SEPARATOR_KEY => '-',
CsvEncoder::AS_COLLECTION_KEY => true, // Can be removed in 5.0
]);
Expand Down

0 comments on commit b4ad9e6

Please sign in to comment.