Skip to content

[DRAFT] un test ExporterCsvTest pour la fonction exporter_csv()

tcharlss a demandé de fusionner dev/exporter_csv vers master

Ça nécessite spip!5455 (merged)

vendor/bin/phpunit --colors --debug --filter ExporterCsvTest

Teste la combinaison des options pour le délimiteur, l'extension et les entêtes. On compare le contenu et l'extension des fichiers produits avec des fichiers de référence.

Restera à compléter les tests pour les options charset, callback, et éventuellement avec des ressources SQL.

On place cela dans un nouveau dossier/groupe Export qui pourra accueillir les autres fonctionnalités d'export.

Refs spip#5447 (closed)


Le test compare les fichiers exportés avec des fichiers locaux présents dans le dépôt. Par contre j'ai eu ce message lors de leur ajout, j'espère que ça pas pas niquer les tests ?

warning: in the working copy of 'tests/Export/expected/csv/commas.csv', CRLF will be replaced by LF the next time Git touches it
warning: in the working copy of 'tests/Export/expected/csv/commas_headless.csv', CRLF will be replaced by LF the next time Git touches it
warning: in the working copy of 'tests/Export/expected/csv/semicolons.csv', CRLF will be replaced by LF the next time Git touches it
warning: in the working copy of 'tests/Export/expected/csv/semicolons.xls', CRLF will be replaced by LF the next time Git touches it
warning: in the working copy of 'tests/Export/expected/csv/tabs.csv', CRLF will be replaced by LF the next time Git touches it
warning: in the working copy of 'tests/Export/expected/csv/tabs.xls', CRLF will be replaced by LF the next time Git touches it

Rapports de requête de fusion