Fixed wrong usage of $tmpFile in Swift backend
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 15 Jan 2014 21:05:01 +0000 (13:05 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 15 Jan 2014 21:05:01 +0000 (13:05 -0800)
Change-Id: I21293be38c53b4dca3030c26a201f70d8ed243f3

includes/filebackend/SwiftFileBackend.php
tests/phpunit/includes/filebackend/FileBackendTest.php

index 9ed6a45..17b9b4d 100644 (file)
@@ -1101,7 +1101,7 @@ class SwiftFileBackend extends FileBackendStore {
                                fclose( $op['stream'] ); // close open handle
                                if ( $rcode >= 200 && $rcode <= 299
                                        // double check that the disk is not full/broken
-                                       && $tmpFile->getSize() == $rhdrs['content-length']
+                                       && $tmpFiles[$path]->getSize() == $rhdrs['content-length']
                                ) {
                                        // good
                                } elseif ( $rcode === 404 ) {
index 1dbc74c..cee2da2 100644 (file)
@@ -1324,7 +1324,7 @@ class FileBackendTest extends MediaWikiTestCase {
                $cases[] = array(
                        array( "$base/unittest-cont1/e/a/x.txt", "$base/unittest-cont1/e/a/y.txt",
                                "$base/unittest-cont1/e/a/z.txt" ),
-                       array( "contents xx", "contents xy", "contents xz" )
+                       array( "contents xx $", "contents xy 111", "contents xz" )
                );
 
                return $cases;
@@ -1391,7 +1391,7 @@ class FileBackendTest extends MediaWikiTestCase {
                $cases[] = array(
                        array( "$base/unittest-cont1/e/a/x.txt", "$base/unittest-cont1/e/a/y.txt",
                                "$base/unittest-cont1/e/a/z.txt" ),
-                       array( "contents xx", "contents xy", "contents xz" )
+                       array( "contents xx 1111", "contents xy %", "contents xz $" )
                );
 
                return $cases;