30 'directory' =>
'/testdir',
33 'transformVia404' =>
false,
35 'name' =>
'local-backend',
38 'cont1' =>
"/testdir/local-backend/tempimages/cont1",
39 'cont2' =>
"/testdir/local-backend/tempimages/cont2"
43 $this->repo_hl0 =
new LocalRepo( [
'hashLevels' => 0 ] + $info );
44 $this->repo_hl2 =
new LocalRepo( [
'hashLevels' => 2 ] + $info );
45 $this->repo_lc =
new LocalRepo( [
'initialCapital' =>
false ] + $info );
46 $this->file_hl0 = $this->repo_hl0->newFile(
'test!' );
47 $this->file_hl2 = $this->repo_hl2->newFile(
'test!' );
48 $this->file_lc = $this->repo_lc->newFile(
'test!' );
55 $this->assertEquals(
'', $this->file_hl0->getHashPath() );
56 $this->assertEquals(
'a/a2/', $this->file_hl2->getHashPath() );
57 $this->assertEquals(
'c/c4/', $this->file_lc->getHashPath() );
64 $this->assertEquals(
'Test!', $this->file_hl0->getRel() );
65 $this->assertEquals(
'a/a2/Test!', $this->file_hl2->getRel() );
66 $this->assertEquals(
'c/c4/test!', $this->file_lc->getRel() );
73 $this->assertEquals(
'Test%21', $this->file_hl0->getUrlRel() );
74 $this->assertEquals(
'a/a2/Test%21', $this->file_hl2->getUrlRel() );
75 $this->assertEquals(
'c/c4/test%21', $this->file_lc->getUrlRel() );
83 'mwstore://local-backend/test-public/archive',
84 $this->file_hl0->getArchivePath()
87 'mwstore://local-backend/test-public/archive/a/a2',
88 $this->file_hl2->getArchivePath()
91 'mwstore://local-backend/test-public/archive/!',
92 $this->file_hl0->getArchivePath(
'!' )
95 'mwstore://local-backend/test-public/archive/a/a2/!',
96 $this->file_hl2->getArchivePath(
'!' )
105 'mwstore://local-backend/test-thumb/Test!',
106 $this->file_hl0->getThumbPath()
109 'mwstore://local-backend/test-thumb/a/a2/Test!',
110 $this->file_hl2->getThumbPath()
113 'mwstore://local-backend/test-thumb/Test!/x',
114 $this->file_hl0->getThumbPath(
'x' )
117 'mwstore://local-backend/test-thumb/a/a2/Test!/x',
118 $this->file_hl2->getThumbPath(
'x' )
126 $this->assertEquals(
'/testurl/archive', $this->file_hl0->getArchiveUrl() );
127 $this->assertEquals(
'/testurl/archive/a/a2', $this->file_hl2->getArchiveUrl() );
128 $this->assertEquals(
'/testurl/archive/%21', $this->file_hl0->getArchiveUrl(
'!' ) );
129 $this->assertEquals(
'/testurl/archive/a/a2/%21', $this->file_hl2->getArchiveUrl(
'!' ) );
136 $this->assertEquals(
'/testurl/thumb/Test%21', $this->file_hl0->getThumbUrl() );
137 $this->assertEquals(
'/testurl/thumb/a/a2/Test%21', $this->file_hl2->getThumbUrl() );
138 $this->assertEquals(
'/testurl/thumb/Test%21/x', $this->file_hl0->getThumbUrl(
'x' ) );
139 $this->assertEquals(
'/testurl/thumb/a/a2/Test%21/x', $this->file_hl2->getThumbUrl(
'x' ) );
146 $this->assertEquals(
'mwrepo://test/public/archive', $this->file_hl0->getArchiveVirtualUrl() );
148 'mwrepo://test/public/archive/a/a2',
149 $this->file_hl2->getArchiveVirtualUrl()
152 'mwrepo://test/public/archive/%21',
153 $this->file_hl0->getArchiveVirtualUrl(
'!' )
156 'mwrepo://test/public/archive/a/a2/%21',
157 $this->file_hl2->getArchiveVirtualUrl(
'!' )
165 $this->assertEquals(
'mwrepo://test/thumb/Test%21', $this->file_hl0->getThumbVirtualUrl() );
166 $this->assertEquals(
'mwrepo://test/thumb/a/a2/Test%21', $this->file_hl2->getThumbVirtualUrl() );
168 'mwrepo://test/thumb/Test%21/%21',
169 $this->file_hl0->getThumbVirtualUrl(
'!' )
172 'mwrepo://test/thumb/a/a2/Test%21/%21',
173 $this->file_hl2->getThumbVirtualUrl(
'!' )
181 $this->assertEquals(
'/testurl/Test%21', $this->file_hl0->getUrl() );
182 $this->assertEquals(
'/testurl/a/a2/Test%21', $this->file_hl2->getUrl() );
193 'wfLocalFile() returns LocalFile for valid Titles'