Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/bookmarks.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarcel Klehr <mklehr@gmx.net>2020-08-16 17:57:11 +0300
committerMarcel Klehr <mklehr@gmx.net>2020-08-16 17:57:11 +0300
commitf18c865819938220a5ee74ab23755324f6f4ceed (patch)
tree2d331b3918b33d267f087a5da15e1b6320c694e2 /tests
parent322155e2288fc3262169cded57f6f850d745fd60 (diff)
Fix cron job
Diffstat (limited to 'tests')
-rw-r--r--tests/BackgroundJobTest.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/BackgroundJobTest.php b/tests/BackgroundJobTest.php
index f0832ca5..84ae6a61 100644
--- a/tests/BackgroundJobTest.php
+++ b/tests/BackgroundJobTest.php
@@ -6,20 +6,45 @@ use OCA\Bookmarks\BackgroundJobs\CrawlJob;
use OC\BackgroundJob\JobList;
use OCA\Bookmarks\Db\Bookmark;
use OCA\Bookmarks\Db\BookmarkMapper;
+use OCP\IConfig;
use PHPUnit\Framework\TestCase;
/**
* Class Test_BackgroundJob
*/
class BackgroundJobTest extends TestCase {
+ /**
+ * @var mixed|\stdClass
+ */
+ private $bookmarkMapper;
+ /**
+ * @var mixed|\stdClass
+ */
+ private $previewsJob;
+ /**
+ * @var mixed|\stdClass
+ */
+ private $jobList;
+ /**
+ * @var mixed|\stdClass
+ */
+ private $settings;
+ /**
+ * @var string
+ */
+ private $userId;
+
protected function setUp() :void {
parent::setUp();
$this->bookmarkMapper = \OC::$server->query(BookmarkMapper::class);
$this->previewsJob = \OC::$server->query(CrawlJob::class);
$this->jobList = \OC::$server->query(JobList::class);
+ $this->settings = \OC::$server->query(IConfig::class);
$this->userId = 'test';
+ $this->settings->setAppValue('bookmarks', 'privacy.enableScraping', 'true');
+
array_map(function ($bm) {
$this->bookmarkMapper->insert($bm);
}, $this->singleBookmarksProvider());
@@ -43,6 +68,7 @@ class BackgroundJobTest extends TestCase {
'Simple URL with title' => ['url' => 'https://nextcloud.com/', 'title' => 'Nextcloud'],
'Simple URL' => ['url' => 'https://php.net/'],
'URL with unicode' => ['url' => 'https://de.wikipedia.org/wiki/%C3%9C'],
+ 'Non-existent URL' => ['url' => 'https://http://www.bllaala.com/'],
]);
}
}