mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-09 18:04:33 +02:00
Allow to specifiy a path to a builtin ressource via the url field.
This commit is contained in:
parent
d99365f906
commit
2001680542
6 changed files with 192 additions and 10 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue