summaryrefslogtreecommitdiffstats
path: root/tests/Integration/Fixtures
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Integration/Fixtures')
-rw-r--r--tests/Integration/Fixtures/FeedFixture.php54
-rw-r--r--tests/Integration/Fixtures/Fixture.php26
-rw-r--r--tests/Integration/Fixtures/FolderFixture.php40
-rw-r--r--tests/Integration/Fixtures/ItemFixture.php56
-rw-r--r--tests/Integration/Fixtures/data/default.php76
-rw-r--r--tests/Integration/Fixtures/data/readitem.php33
6 files changed, 0 insertions, 285 deletions
diff --git a/tests/Integration/Fixtures/FeedFixture.php b/tests/Integration/Fixtures/FeedFixture.php
deleted file mode 100644
index 0c1e31af9..000000000
--- a/tests/Integration/Fixtures/FeedFixture.php
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-/**
- * Nextcloud - News
- *
- * This file is licensed under the Affero General Public License version 3 or
- * later. See the COPYING file.
- *
- * @author Bernhard Posselt <dev@bernhard-posselt.com>
- * @copyright Bernhard Posselt 2015
- */
-
-
-namespace OCA\News\Tests\Integration\Fixtures;
-
-use OCA\News\Db\Feed;
-
-class FeedFixture extends Feed
-{
-
- use Fixture;
-
- public function __construct(array $defaults = [])
- {
- parent::__construct();
- $defaults = array_merge(
- [
- 'userId' => 'test',
- 'urlHash' => 'urlHash',
- 'url' => 'http://the.url.com',
- 'title' => 'title',
- 'faviconLink' => 'http://feed.com/favicon.ico',
- 'added' => 3000,
- 'folderId' => null,
- 'link' => 'http://feed.com/rss',
- 'preventUpdate' => false,
- 'deletedAt' => 0,
- 'articlesPerUpdate' => 40,
- 'httpLastModified' => 10,
- 'httpEtag' => '',
- 'location' => 'http://feed.com/rss',
- 'ordering' => 0,
- 'fullTextEnabled' => false,
- 'pinned' => false,
- 'updateMode' => 0,
- 'updateErrorCount' => 0,
- 'lastUpdateError' => '',
- ],
- $defaults
- );
- unset($defaults['items']);
- $this->fillDefaults($defaults);
- }
-
-}
diff --git a/tests/Integration/Fixtures/Fixture.php b/tests/Integration/Fixtures/Fixture.php
deleted file mode 100644
index 366c93228..000000000
--- a/tests/Integration/Fixtures/Fixture.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-/**
- * Nextcloud - News
- *
- * This file is licensed under the Affero General Public License version 3 or
- * later. See the COPYING file.
- *
- * @author Bernhard Posselt <dev@bernhard-posselt.com>
- * @copyright Bernhard Posselt 2015
- */
-
-
-namespace OCA\News\Tests\Integration\Fixtures;
-
-
-trait Fixture
-{
- protected function fillDefaults(array $defaults = [])
- {
- foreach ($defaults as $key => $value) {
- $method = 'set' . ucfirst($key);
- $this->$method($value);
- }
- }
-
-} \ No newline at end of file
diff --git a/tests/Integration/Fixtures/FolderFixture.php b/tests/Integration/Fixtures/FolderFixture.php
deleted file mode 100644
index ffd6042c0..000000000
--- a/tests/Integration/Fixtures/FolderFixture.php
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php
-/**
- * Nextcloud - News
- *
- * This file is licensed under the Affero General Public License version 3 or
- * later. See the COPYING file.
- *
- * @author Bernhard Posselt <dev@bernhard-posselt.com>
- * @copyright Bernhard Posselt 2015
- */
-
-
-namespace OCA\News\Tests\Integration\Fixtures;
-
-use OCA\News\Db\Folder;
-
-class FolderFixture extends Folder
-{
- use Fixture;
-
- public function __construct(array $defaults = [])
- {
- parent::__construct();
-
- $defaults = array_merge(
- [
- 'parentId' => null,
- 'name' => 'folder',
- 'userId' => 'test',
- 'opened' => true,
- 'deletedAt' => 0,
- 'lastModified' => 9
- ],
- $defaults
- );
- unset($defaults['feeds']);
- $this->fillDefaults($defaults);
- }
-
-} \ No newline at end of file
diff --git a/tests/Integration/Fixtures/ItemFixture.php b/tests/Integration/Fixtures/ItemFixture.php
deleted file mode 100644
index 978b12b55..000000000
--- a/tests/Integration/Fixtures/ItemFixture.php
+++ /dev/null
@@ -1,56 +0,0 @@
-<?php
-/**
- * Nextcloud - News
- *
- * This file is licensed under the Affero General Public License version 3 or
- * later. See the COPYING file.
- *
- * @author Bernhard Posselt <dev@bernhard-posselt.com>
- * @copyright Bernhard Posselt 2015
- */
-
-
-namespace OCA\News\Tests\Integration\Fixtures;
-
-use OCA\News\Db\Item;
-
-class ItemFixture extends Item
-{
- use Fixture;
-
- public function __construct(array $defaults = [])
- {
- parent::__construct();
- $defaults = array_merge(
- [
- 'url' => 'http://google.de',
- 'title' => 'title',
- 'author' => 'my author',
- 'pubDate' => 2323,
- 'body' => 'this is a body',
- 'enclosureMime' => 'video/mpeg',
- 'enclosureLink' => 'http://google.de/web.webm',
- 'mediaThumbnail' => 'https://i3.ytimg.com/vi/Zgge1O9wdPY/hqdefault.jpg',
- 'mediaDescription' => 'The best video ever',
- 'feedId' => 0,
- 'unread' => true,
- 'starred' => false,
- 'lastModified' => 113,
- 'rtl' => false,
- ],
- $defaults
- );
-
- if (!array_key_exists('guid', $defaults)) {
- $defaults['guid'] = $defaults['title'];
- }
-
- if (!array_key_exists('guidHash', $defaults)) {
- $defaults['guidHash'] = $defaults['guid'];
- }
-
- $this->fillDefaults($defaults);
- $this->generateSearchIndex();
- }
-
-}
diff --git a/tests/Integration/Fixtures/data/default.php b/tests/Integration/Fixtures/data/default.php
deleted file mode 100644
index 41935b5c6..000000000
--- a/tests/Integration/Fixtures/data/default.php
+++ /dev/null
@@ -1,76 +0,0 @@
-<?php
-/**
- * Nextcloud - News
- *
- * This file is licensed under the Affero General Public License version 3 or
- * later. See the COPYING file.
- *
- * @author Bernhard Posselt <dev@bernhard-posselt.com>
- * @copyright Bernhard Posselt 2015
- */
-
-return [
- 'folders' => [
- [
- 'name' => 'first folder',
- 'feeds' => [
- [
- 'title' => 'first feed',
- 'url' => 'http://google.de',
- 'articlesPerUpdate' => 1,
- 'items' => [
- ['title' => 'a title1', 'guid' => 'abc'],
- ['title' => 'a title2', 'unread' => false, 'starred' => true, 'guid' => 'def'],
- ['title' => 'a title3', 'unread' => true, 'starred' => true, 'guid' => 'gih'],
- ['title' => 'del1', 'unread' => false, 'starred' => false],
- ['title' => 'del2', 'unread' => false, 'starred' => false],
- ['title' => 'del3', 'unread' => false, 'starred' => false],
- ['title' => 'del4', 'unread' => false, 'starred' => false]
- ]
- ],
- [
- 'title' => 'second feed',
- 'url' => 'http://golem.de',
- 'items' => []
- ],
- ],
- ],
- [
- 'name' => 'second folder',
- 'opened' => false,
- 'feeds' => [
- [
- 'title' => 'third feed',
- 'url' => 'http://heise.de',
- 'items' => [['title' => 'a title9']]
- ],
- [
- 'title' => 'sixth feed',
- 'url' => 'http://gremlins.de',
- 'deletedAt' => 999999999,
- 'items' => [['title' => 'not found feed', 'guid' => 'not found']]
- ]
- ],
- ],
- [
- 'name' => 'third folder',
- 'deletedAt' => 9999999999,
- 'feeds' => [
- [
- 'title' => 'fifth feed',
- 'url' => 'http://prolinux.de',
- 'items' => [['title' => 'not found folder', 'guid' => 'not found']]
- ]
- ],
- ]
- ],
- 'feeds' => [
- [
- 'title' => 'fourth feed',
- 'url' => 'http://blog.fefe.de',
- 'items' => [
- ['title' => 'no folder', 'unread' => false, 'starred' => false]
- ]
- ]
- ]
-]; \ No newline at end of file
diff --git a/tests/Integration/Fixtures/data/readitem.php b/tests/Integration/Fixtures/data/readitem.php
deleted file mode 100644
index 425492741..000000000
--- a/tests/Integration/Fixtures/data/readitem.php
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-/**
- * Nextcloud - News
- *
- * This file is licensed under the Affero General Public License version 3 or
- * later. See the COPYING file.
- *
- * @author Bernhard Posselt <dev@bernhard-posselt.com>
- * @copyright Bernhard Posselt 2015
- */
-
-return [
- 'feeds' => [
- [
- 'title' => 'john feed',
- 'userId' => 'john',
- 'items' => [
- ['title' => 'blubb', 'unread' => true, 'starred' => false],
- ['title' => 'blubb', 'unread' => true, 'starred' => false]
- ]
- ],
- [
- 'title' => 'test feed',
- 'userId' => 'test',
- 'items' => [
- ['title' => 'blubb', 'unread' => true, 'starred' => false],
- ['title' => 'blubbs', 'unread' => true, 'starred' => false],
- ['title' => 'blubb', 'unread' => true, 'starred' => false],
- ['title' => 'blubb', 'unread' => true, 'starred' => false]
- ]
- ]
- ]
-];