18 'directory' =>
'/testdir',
21 'transformVia404' =>
false,
23 'name' =>
'local-backend',
24 'wikiId' => wfWikiId(),
25 'containerPaths' =>
array(
26 'cont1' =>
"/testdir/local-backend/tempimages/cont1",
27 'cont2' =>
"/testdir/local-backend/tempimages/cont2"
31 $this->repo_hl0 =
new LocalRepo(
array(
'hashLevels' => 0 ) + $info );
32 $this->repo_hl2 =
new LocalRepo(
array(
'hashLevels' => 2 ) + $info );
33 $this->repo_lc =
new LocalRepo(
array(
'initialCapital' =>
false ) + $info );
34 $this->file_hl0 = $this->repo_hl0->newFile(
'test!' );
35 $this->file_hl2 = $this->repo_hl2->newFile(
'test!' );
36 $this->file_lc = $this->repo_lc->newFile(
'test!' );
43 $this->assertEquals(
'', $this->file_hl0->getHashPath() );
44 $this->assertEquals(
'a/a2/', $this->file_hl2->getHashPath() );
45 $this->assertEquals(
'c/c4/', $this->file_lc->getHashPath() );
52 $this->assertEquals(
'Test!', $this->file_hl0->getRel() );
53 $this->assertEquals(
'a/a2/Test!', $this->file_hl2->getRel() );
54 $this->assertEquals(
'c/c4/test!', $this->file_lc->getRel() );
61 $this->assertEquals(
'Test%21', $this->file_hl0->getUrlRel() );
62 $this->assertEquals(
'a/a2/Test%21', $this->file_hl2->getUrlRel() );
63 $this->assertEquals(
'c/c4/test%21', $this->file_lc->getUrlRel() );
70 $this->assertEquals(
'mwstore://local-backend/test-public/archive', $this->file_hl0->getArchivePath() );
71 $this->assertEquals(
'mwstore://local-backend/test-public/archive/a/a2', $this->file_hl2->getArchivePath() );
72 $this->assertEquals(
'mwstore://local-backend/test-public/archive/!', $this->file_hl0->getArchivePath(
'!' ) );
73 $this->assertEquals(
'mwstore://local-backend/test-public/archive/a/a2/!', $this->file_hl2->getArchivePath(
'!' ) );
80 $this->assertEquals(
'mwstore://local-backend/test-thumb/Test!', $this->file_hl0->getThumbPath() );
81 $this->assertEquals(
'mwstore://local-backend/test-thumb/a/a2/Test!', $this->file_hl2->getThumbPath() );
82 $this->assertEquals(
'mwstore://local-backend/test-thumb/Test!/x', $this->file_hl0->getThumbPath(
'x' ) );
83 $this->assertEquals(
'mwstore://local-backend/test-thumb/a/a2/Test!/x', $this->file_hl2->getThumbPath(
'x' ) );
90 $this->assertEquals(
'/testurl/archive', $this->file_hl0->getArchiveUrl() );
91 $this->assertEquals(
'/testurl/archive/a/a2', $this->file_hl2->getArchiveUrl() );
92 $this->assertEquals(
'/testurl/archive/%21', $this->file_hl0->getArchiveUrl(
'!' ) );
93 $this->assertEquals(
'/testurl/archive/a/a2/%21', $this->file_hl2->getArchiveUrl(
'!' ) );
100 $this->assertEquals(
'/testurl/thumb/Test%21', $this->file_hl0->getThumbUrl() );
101 $this->assertEquals(
'/testurl/thumb/a/a2/Test%21', $this->file_hl2->getThumbUrl() );
102 $this->assertEquals(
'/testurl/thumb/Test%21/x', $this->file_hl0->getThumbUrl(
'x' ) );
103 $this->assertEquals(
'/testurl/thumb/a/a2/Test%21/x', $this->file_hl2->getThumbUrl(
'x' ) );
110 $this->assertEquals(
'mwrepo://test/public/archive', $this->file_hl0->getArchiveVirtualUrl() );
111 $this->assertEquals(
'mwrepo://test/public/archive/a/a2', $this->file_hl2->getArchiveVirtualUrl() );
112 $this->assertEquals(
'mwrepo://test/public/archive/%21', $this->file_hl0->getArchiveVirtualUrl(
'!' ) );
113 $this->assertEquals(
'mwrepo://test/public/archive/a/a2/%21', $this->file_hl2->getArchiveVirtualUrl(
'!' ) );
120 $this->assertEquals(
'mwrepo://test/thumb/Test%21', $this->file_hl0->getThumbVirtualUrl() );
121 $this->assertEquals(
'mwrepo://test/thumb/a/a2/Test%21', $this->file_hl2->getThumbVirtualUrl() );
122 $this->assertEquals(
'mwrepo://test/thumb/Test%21/%21', $this->file_hl0->getThumbVirtualUrl(
'!' ) );
123 $this->assertEquals(
'mwrepo://test/thumb/a/a2/Test%21/%21', $this->file_hl2->getThumbVirtualUrl(
'!' ) );
130 $this->assertEquals(
'/testurl/Test%21', $this->file_hl0->getUrl() );
131 $this->assertEquals(
'/testurl/a/a2/Test%21', $this->file_hl2->getUrl() );
139 $this->assertThat(
$file, $this->isInstanceOf(
'LocalFile' ),
'wfLocalFile() returns LocalFile for valid Titles' );