r108308 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108307‎ | r108308 | r108309 >
Date:06:13, 7 January 2012
Author:aaron
Status:ok
Tags:
Comment:
Dependency inject the repo/backend for proper testing rather than relying on the wiki config
Modified paths:
  • /trunk/phase3/tests/phpunit/includes/filerepo/StoreBatchTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/filerepo/StoreBatchTest.php
@@ -6,8 +6,20 @@
77
88 public function setUp() {
99 parent::setUp();
10 -
11 - $this->repo = RepoGroup::singleton()->getLocalRepo();
 10+ $tmpDir = wfTempDir() . '/' . time() . '-' . mt_rand();
 11+ $this->repo = new FSRepo( array(
 12+ 'name' => 'test',
 13+ 'backend' => new FSFileBackend( array(
 14+ 'name' => 'local-backend',
 15+ 'lockManager' => 'nullLockManager',
 16+ 'containerPaths' => array(
 17+ 'test-public' => "$tmpDir/public",
 18+ 'test-thumb' => "$tmpDir/thumb",
 19+ 'test-temp' => "$tmpDir/temp",
 20+ 'test-deleted' => "$tmpDir/deleted",
 21+ )
 22+ ) )
 23+ ) );
1224 $this->date = gmdate( "YmdHis" );
1325 $this->createdFiles = array();
1426 $this->users = array(
@@ -43,8 +55,7 @@
4456 $this->createdFiles[] = $result->value;
4557 return $result;
4658 }
47 -
48 -
 59+
4960 /**
5061 * Test storing a file using different flags.
5162 *
@@ -97,6 +108,5 @@
98109 public function tearDown() {
99110 $this->repo->cleanupBatch( $this->createdFiles );
100111 parent::tearDown();
101 -
102112 }
103113 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r108503StoreBatchText note about using custom repo...hashar14:26, 10 January 2012

Status & tagging log