r64396 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64395‎ | r64396 | r64397 >
Date:17:03, 30 March 2010
Author:mah
Status:ok
Tags:
Comment:
whitespace removal
Modified paths:
  • /trunk/phase3/maintenance/tests/UploadTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/tests/UploadTest.php
@@ -4,47 +4,47 @@
55 */
66 class UploadTest extends PHPUnit_Framework_TestCase {
77 protected $upload;
8 -
98
 9+
1010 function setUp() {
1111 parent::setup();
12 - $this->upload = new UploadTestHandler;
 12+ $this->upload = new UploadTestHandler;
1313 }
14 -
 14+
1515 /**
1616 * Test various forms of valid and invalid titles that can be supplied.
1717 */
1818 public function testTitleValidation() {
1919
20 -
 20+
2121 /* Test a valid title */
22 - $this->assertUploadTitleAndCode( 'ValidTitle.jpg',
 22+ $this->assertUploadTitleAndCode( 'ValidTitle.jpg',
2323 'ValidTitle.jpg', UploadTestHandler::OK,
2424 'upload valid title' );
25 -
 25+
2626 /* A title with a slash */
2727 $this->assertUploadTitleAndCode( 'A/B.jpg',
2828 'B.jpg', UploadTestHandler::OK,
2929 'upload title with slash' );
30 -
 30+
3131 /* A title with illegal char */
3232 $this->assertUploadTitleAndCode( 'A:B.jpg',
3333 'A-B.jpg', UploadTestHandler::OK,
3434 'upload title with colon' );
35 -
 35+
3636 /* A title without extension */
3737 $this->assertUploadTitleAndCode( 'A',
3838 null, UploadTestHandler::FILETYPE_MISSING,
3939 'upload title without extension' );
40 -
 40+
4141 /* A title with no basename */
4242 $this->assertUploadTitleAndCode( '.jpg',
4343 null, UploadTestHandler::MIN_LENGTH_PARTNAME,
4444 'upload title without basename' );
45 -
 45+
4646 }
4747 /**
48 - * Helper function for testTitleValidation. First checks the return code
 48+ * Helper function for testTitleValidation. First checks the return code
4949 * of UploadBase::getTitle() and then the actual returned titl
5050 */
5151 private function assertUploadTitleAndCode( $srcFilename, $dstFilename, $code, $msg ) {
@@ -52,7 +52,7 @@
5353 $this->assertEquals( $code,
5454 $this->upload->testTitleValidation( $srcFilename ),
5555 "$msg code" );
56 -
 56+
5757 /* If we expect a valid title, check the title itself. */
5858 if ( $code == UploadTestHandler::OK ) {
5959 $this->assertEquals( $dstFilename,
@@ -60,7 +60,7 @@
6161 "$msg text" );
6262 }
6363 }
64 -
 64+
6565 /**
6666 * Test the upload verification functions
6767 */
@@ -69,7 +69,7 @@
7070 $this->upload->initializePathInfo( '', '', 0 );
7171 $result = $this->upload->verifyUpload();
7272 $this->assertEquals( UploadTestHandler::EMPTY_FILE,
73 - $result['status'],
 73+ $result['status'],
7474 'upload empty file' );
7575 }
7676

Status & tagging log