From 6a1bb85f803860c099b40296cc717e857187b5e3 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sat, 7 Jan 2012 09:26:11 +0000 Subject: [PATCH] r108300: updated parserTest.inc tests and re-enabled testBug29408() --- tests/parser/parserTest.inc | 16 ++++++++-------- .../includes/upload/UploadStashTest.php | 18 +++++++----------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/tests/parser/parserTest.inc b/tests/parser/parserTest.inc index 7b82b22afe..5584596648 100644 --- a/tests/parser/parserTest.inc +++ b/tests/parser/parserTest.inc @@ -159,10 +159,10 @@ class ParserTest { 'name' => 'local-backend', 'lockManager' => 'fsLockManager', 'containerPaths' => array( - 'media-public' => wfTempDir() . '/test-repo/public', - 'media-thumb' => wfTempDir() . '/test-repo/thumb', - 'media-temp' => wfTempDir() . '/test-repo/temp', - 'media-deleted' => wfTempDir() . '/test-repo/delete', + 'local-public' => wfTempDir() . '/test-repo/public', + 'local-thumb' => wfTempDir() . '/test-repo/thumb', + 'local-temp' => wfTempDir() . '/test-repo/temp', + 'local-deleted' => wfTempDir() . '/test-repo/deleted', ) ) ) ); @@ -637,10 +637,10 @@ class ParserTest { 'name' => 'local-backend', 'lockManager' => 'fsLockManager', 'containerPaths' => array( - 'media-public' => $this->uploadDir, - 'media-thumb' => $this->uploadDir . '/thumb', - 'media-temp' => $this->uploadDir . '/temp', - 'media-deleted' => $this->uploadDir . '/delete', + 'local-public' => $this->uploadDir, + 'local-thumb' => $this->uploadDir . '/thumb', + 'local-temp' => $this->uploadDir . '/temp', + 'local-deleted' => $this->uploadDir . '/delete', ) ) ) ), diff --git a/tests/phpunit/includes/upload/UploadStashTest.php b/tests/phpunit/includes/upload/UploadStashTest.php index 6299ae5249..c9dbb1388e 100644 --- a/tests/phpunit/includes/upload/UploadStashTest.php +++ b/tests/phpunit/includes/upload/UploadStashTest.php @@ -10,11 +10,11 @@ class UploadStashTest extends MediaWikiTestCase { public function setUp() { parent::setUp(); - + // Setup a file for bug 29408 $this->bug29408File = dirname( __FILE__ ) . '/bug29408'; - file_put_contents( $this->bug29408File, "\x00" ); - + file_put_contents( $this->bug29408File, "\x00" ); + self::$users = array( 'sysop' => new ApiTestUser( 'Uploadstashtestsysop', @@ -30,21 +30,19 @@ class UploadStashTest extends MediaWikiTestCase { ) ); } - + public function testBug29408() { global $wgUser; $wgUser = self::$users['uploader']->user; - + $repo = RepoGroup::singleton()->getLocalRepo(); $stash = new UploadStash( $repo ); - $this->markTestIncomplete( 'Broken' ); - // Throws exception caught by PHPUnit on failure $file = $stash->stashFile( $this->bug29408File ); // We'll never reach this point if we hit bug 29408 $this->assertTrue( true, 'Unrecognized file without extension' ); - + $stash->removeFile( $file->getFileKey() ); } @@ -65,11 +63,9 @@ class UploadStashTest extends MediaWikiTestCase { $this->assertTrue( UploadFromStash::isValidRequest($request), 'Check key precedence' ); } - - public function tearDown() { parent::tearDown(); - + if( file_exists( $this->bug29408File . "." ) ) { unlink( $this->bug29408File . "." ); } -- 2.20.1