Merge "(bug 47070) check content model namespace on import."
[lhc/web/wiklou.git] / tests / phpunit / includes / parser / NewParserTest.php
index eac4de5..c742444 100644 (file)
@@ -306,7 +306,9 @@ class NewParserTest extends MediaWikiTestCase {
                                        }
                                }
                                $useConfig['name'] = 'local-backend'; // swap name
-                               $class = $conf['class'];
+                               unset( $useConfig['lockManager'] );
+                               unset( $useConfig['fileJournal'] );
+                               $class = $useConfig['class'];
                                self::$backendToUse = new $class( $useConfig );
                                $backend = self::$backendToUse;
                        }
@@ -316,11 +318,7 @@ class NewParserTest extends MediaWikiTestCase {
                        # informations.
                        $backend = new MockFileBackend( array(
                                'name' => 'local-backend',
-                               'lockManager' => 'nullLockManager',
-                               'containerPaths' => array(
-                                       'local-public' => "$uploadDir",
-                                       'local-thumb' => "$uploadDir/thumb",
-                               )
+                               'wikiId' => wfWikiId()
                        ) );
                }
 
@@ -446,16 +444,12 @@ class NewParserTest extends MediaWikiTestCase {
                ) );
 
                // No helpful SVG file to copy, so make one ourselves
-               $tmpDir = wfTempDir();
-               $tempFsFile = new TempFSFile( "$tmpDir/Foobar.svg" );
-               $tempFsFile->autocollect(); // destroy file when $tempFsFile leaves scope
-               file_put_contents( "$tmpDir/Foobar.svg",
-                       '<?xml version="1.0" encoding="utf-8"?>' .
-                       '<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><text>Foo</text></svg>' );
+               $data = '<?xml version="1.0" encoding="utf-8"?>' .
+                       '<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><text>Foo</text></svg>';
 
                $backend->prepare( array( 'dir' => "$base/local-public/f/ff" ) );
-               $backend->quickStore( array(
-                       'src' => "$tmpDir/Foobar.svg", 'dst' => "$base/local-public/f/ff/Foobar.svg"
+               $backend->quickCreate( array(
+                       'content' => $data, 'dst' => "$base/local-public/f/ff/Foobar.svg"
                ) );
        }