https://www.mediawiki.org/wiki/Special:Code/MediaWiki/108308
Revision: 108308
Author: aaron
Date: 2012-01-07 06:13:01 +0000 (Sat, 07 Jan 2012)
Log Message:
-----------
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: trunk/phase3/tests/phpunit/includes/filerepo/StoreBatchTest.php
===================================================================
--- trunk/phase3/tests/phpunit/includes/filerepo/StoreBatchTest.php
2012-01-07 04:30:23 UTC (rev 108307)
+++ trunk/phase3/tests/phpunit/includes/filerepo/StoreBatchTest.php
2012-01-07 06:13:01 UTC (rev 108308)
@@ -6,8 +6,20 @@
public function setUp() {
parent::setUp();
-
- $this->repo = RepoGroup::singleton()->getLocalRepo();
+ $tmpDir = wfTempDir() . '/' . time() . '-' . mt_rand();
+ $this->repo = new FSRepo( array(
+ 'name' => 'test',
+ 'backend' => new FSFileBackend( array(
+ 'name' => 'local-backend',
+ 'lockManager' => 'nullLockManager',
+ 'containerPaths' => array(
+ 'test-public' => "$tmpDir/public",
+ 'test-thumb' => "$tmpDir/thumb",
+ 'test-temp' => "$tmpDir/temp",
+ 'test-deleted' => "$tmpDir/deleted",
+ )
+ ) )
+ ) );
$this->date = gmdate( "YmdHis" );
$this->createdFiles = array();
$this->users = array(
@@ -43,8 +55,7 @@
$this->createdFiles[] = $result->value;
return $result;
}
-
-
+
/**
* Test storing a file using different flags.
*
@@ -97,6 +108,5 @@
public function tearDown() {
$this->repo->cleanupBatch( $this->createdFiles );
parent::tearDown();
-
}
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs