Skip to content

Commit 67f056f

Browse files
committed
Add more unit tests
1 parent 82bbc1c commit 67f056f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/framework/tests/Unit/Support/MediaFileTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,17 @@ public function testAbsoluteMediaPathIsNormalizedToRelativeMediaPath()
101101
$this->assertSame('_media/foo', MediaFile::make(Hyde::path('_media/foo'))->path);
102102
}
103103

104+
public function testCustomMediaPathsAreNormalizedToRelativeCustomizedMediaPath()
105+
{
106+
Hyde::setMediaDirectory('bar');
107+
108+
$this->assertSame('bar/foo', MediaFile::make('foo')->path);
109+
$this->assertSame('bar/foo', MediaFile::make('bar/foo')->path);
110+
$this->assertSame('bar/foo', MediaFile::make(Hyde::path('foo'))->path);
111+
112+
Hyde::setMediaDirectory('_media');
113+
}
114+
104115
public function testGetNameReturnsNameOfFile()
105116
{
106117
$this->assertSame('foo.txt', MediaFile::make('foo.txt')->getName());

0 commit comments

Comments
 (0)