Skip to content

Commit

Permalink
Merge branch '5.4' into 6.4
Browse files Browse the repository at this point in the history
* 5.4:
  remove custom CSV escape character from tests
  fix compatibility with Twig 3.12 and 4.0
  • Loading branch information
xabbuh committed Aug 16, 2024
2 parents 5f9d7e2 + b4ad9e6 commit 8ece294
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 @@ -149,7 +149,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 @@ -175,7 +175,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 @@ -185,7 +185,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 @@ -574,7 +574,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 @@ -596,7 +596,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 @@ -606,7 +606,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 8ece294

Please sign in to comment.