Allow to specifiy a path to a builtin ressource via the url field.

This commit is contained in:
Jan Böhmer 2019-09-25 16:03:22 +02:00
parent d99365f906
commit 2001680542
6 changed files with 192 additions and 10 deletions

View file

@ -105,6 +105,27 @@ class AttachmentTest extends TestCase
$this->assertTrue($attachment->isPicture());
}
public function testIsBuiltIn()
{
$attachment = new PartAttachment();
$this->setProtectedProperty($attachment, 'path', '%MEDIA%/foo/bar.txt');
$this->assertFalse($attachment->isBuiltIn());
$this->setProtectedProperty($attachment, 'path', '%BASE%/foo/bar.txt');
$this->assertFalse($attachment->isBuiltIn());
$this->setProtectedProperty($attachment, 'path', '/');
$this->assertFalse($attachment->isBuiltIn());
$this->setProtectedProperty($attachment, 'path', 'https://google.de');
$this->assertFalse($attachment->isBuiltIn());
$this->setProtectedProperty($attachment, 'path', '%FOOTPRINTS%/foo/bar.txt');
$this->assertTrue($attachment->isBuiltIn());
}
public function testGetHost()
{
$attachment = new PartAttachment();