summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Molenaar <SMillerDev@users.noreply.github.com>2018-10-04 11:09:59 +0200
committerGitHub <noreply@github.com>2018-10-04 11:09:59 +0200
commitb3b15f943162f4afff8b41e3354394a6d14c40f6 (patch)
tree71658d967ea29f3f30014da0f0983a0274480101
parent21e6f5cd6e4d75655872c58d887d6457530b4b04 (diff)
parent4456ef4a338206df655bf738f4ac850475c94032 (diff)
Merge pull request #345 from Grotax/add_date_to_export
add date to export .opml
-rw-r--r--lib/Controller/ExportController.php3
-rw-r--r--tests/Unit/Db/FeedTest.php14
2 files changed, 9 insertions, 8 deletions
diff --git a/lib/Controller/ExportController.php b/lib/Controller/ExportController.php
index 1ce81963d..07ce06f45 100644
--- a/lib/Controller/ExportController.php
+++ b/lib/Controller/ExportController.php
@@ -59,7 +59,8 @@ class ExportController extends Controller
$feeds = $this->feedService->findAll($this->userId);
$folders = $this->folderService->findAll($this->userId);
$opml = $this->opmlExporter->build($folders, $feeds)->saveXML();
- $name = 'subscriptions.opml';
+ $date = date('Y-m-d');
+ $name = "subscriptions-".$date.".opml";
$mimeType = 'text/xml';
return new TextDownloadResponse($opml, $name, $mimeType);
}
diff --git a/tests/Unit/Db/FeedTest.php b/tests/Unit/Db/FeedTest.php
index 53bfe63f4..47595633d 100644
--- a/tests/Unit/Db/FeedTest.php
+++ b/tests/Unit/Db/FeedTest.php
@@ -20,7 +20,7 @@ class FeedTest extends TestCase
{
- private function createFeed()
+ private function createFeed()
{
$feed = new Feed();
$feed->setId(3);
@@ -45,7 +45,7 @@ class FeedTest extends TestCase
return $feed;
}
- public function testToAPI()
+ public function testToAPI()
{
$feed = $this->createFeed();
@@ -68,7 +68,7 @@ class FeedTest extends TestCase
}
- public function testSerialize()
+ public function testSerialize()
{
$feed = $this->createFeed();
@@ -102,9 +102,9 @@ class FeedTest extends TestCase
}
- public function testSetXSSUrl()
+ public function testSetXSSUrl()
{
- $this->setExpectedException(\TypeError::class);
+ $this->expectException(\TypeError::class);
$feed = new Feed();
$feed->setUrl('javascript:alert()');
@@ -112,7 +112,7 @@ class FeedTest extends TestCase
}
- public function testSetUrlUpdatesHash()
+ public function testSetUrlUpdatesHash()
{
$feed = new Feed();
$feed->setUrl('http://test');
@@ -120,7 +120,7 @@ class FeedTest extends TestCase
}
- public function testSetXSSLink()
+ public function testSetXSSLink()
{
$feed = new Feed();
$feed->setLink('javascript:alert()');