public function testSingleSlash() { $this->
assertSame($csv = "0\n\\\n",
$this->encoder->
encode($data =
['\\'
], 'csv'
));
$this->
assertSame($data,
$this->encoder->
decode($csv, 'csv',
[CsvEncoder::AS_COLLECTION_KEY => false
]));
$this->
assertSame($data,
$this->encoder->
decode(trim($csv), 'csv',
[CsvEncoder::AS_COLLECTION_KEY => false
]));
} public function testSupportEncoding() { $this->
assertTrue($this->encoder->
supportsEncoding('csv'
));
$this->
assertFalse($this->encoder->
supportsEncoding('foo'
));
} public function testEncode() { $value =
['foo' => 'hello', 'bar' => 'hey ho'
];
$this->
assertEquals(<<<'CSV'
foo,bar
hello,"hey ho"