mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
Fix route parameters
Improve export tests Improve CSV export
This commit is contained in:
parent
268e9e7277
commit
cceca9ea1d
3 changed files with 108 additions and 8 deletions
|
@ -9,6 +9,9 @@ use JMS\Serializer;
|
|||
use JMS\Serializer\SerializerBuilder;
|
||||
use JMS\Serializer\SerializationContext;
|
||||
|
||||
/**
|
||||
* This class doesn't have unit test BUT it's fully covered by a functional test with ExportControllerTest.
|
||||
*/
|
||||
class EntriesExport
|
||||
{
|
||||
private $wallabagUrl;
|
||||
|
@ -303,7 +306,8 @@ class EntriesExport
|
|||
array(
|
||||
$entry->getTitle(),
|
||||
$entry->getURL(),
|
||||
$entry->getContent(),
|
||||
// remove new line to avoid crazy results
|
||||
str_replace(array("\r\n", "\r", "\n"), '', $entry->getContent()),
|
||||
implode(', ', $entry->getTags()->toArray()),
|
||||
$entry->getMimetype(),
|
||||
$entry->getLanguage(),
|
||||
|
@ -363,7 +367,11 @@ class EntriesExport
|
|||
{
|
||||
$serializer = SerializerBuilder::create()->build();
|
||||
|
||||
return $serializer->serialize($this->entries, $format, SerializationContext::create()->setGroups(array('entries_for_user')));
|
||||
return $serializer->serialize(
|
||||
$this->entries,
|
||||
$format,
|
||||
SerializationContext::create()->setGroups(array('entries_for_user'))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue