summaryrefslogtreecommitdiff
path: root/tests/units/ExternalLink/AttachmentLinkTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/units/ExternalLink/AttachmentLinkTest.php')
-rw-r--r--tests/units/ExternalLink/AttachmentLinkTest.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/units/ExternalLink/AttachmentLinkTest.php b/tests/units/ExternalLink/AttachmentLinkTest.php
new file mode 100644
index 00000000..0211869c
--- /dev/null
+++ b/tests/units/ExternalLink/AttachmentLinkTest.php
@@ -0,0 +1,18 @@
+<?php
+
+require_once __DIR__.'/../Base.php';
+
+use Kanboard\ExternalLink\AttachmentLink;
+
+class AttachmentLinkTest extends Base
+{
+ public function testGetTitleFromUrl()
+ {
+ $url = 'https://kanboard.net/folder/document.pdf';
+
+ $link = new AttachmentLink($this->container);
+ $link->setUrl($url);
+ $this->assertEquals($url, $link->getUrl());
+ $this->assertEquals('document.pdf', $link->getTitle());
+ }
+}