Add session_write_close() calls to SessionManager tests
[lhc/web/wiklou.git] / tests / phpunit / includes / resourceloader / ResourceLoaderStartUpModuleTest.php
index 1e09e92..564f50b 100644 (file)
@@ -56,7 +56,7 @@ mw.loader.register( [
                                'msg' => 'Version falls back gracefully if getVersionHash throws',
                                'modules' => [
                                        'test.fail' => (
-                                               ( $mock = $this->getMockBuilder( 'ResourceLoaderTestModule' )
+                                               ( $mock = $this->getMockBuilder( ResourceLoaderTestModule::class )
                                                        ->setMethods( [ 'getVersionHash' ] )->getMock() )
                                                && $mock->method( 'getVersionHash' )->will(
                                                        $this->throwException( new Exception )
@@ -81,7 +81,7 @@ mw.loader.state( {
                                'msg' => 'Use version from getVersionHash',
                                'modules' => [
                                        'test.version' => (
-                                               ( $mock = $this->getMockBuilder( 'ResourceLoaderTestModule' )
+                                               ( $mock = $this->getMockBuilder( ResourceLoaderTestModule::class )
                                                        ->setMethods( [ 'getVersionHash' ] )->getMock() )
                                                && $mock->method( 'getVersionHash' )->willReturn( '1234567' )
                                        ) ? $mock : $mock
@@ -101,7 +101,7 @@ mw.loader.register( [
                                'msg' => 'Re-hash version from getVersionHash if too long',
                                'modules' => [
                                        'test.version' => (
-                                               ( $mock = $this->getMockBuilder( 'ResourceLoaderTestModule' )
+                                               ( $mock = $this->getMockBuilder( ResourceLoaderTestModule::class )
                                                        ->setMethods( [ 'getVersionHash' ] )->getMock() )
                                                && $mock->method( 'getVersionHash' )->willReturn( '12345678' )
                                        ) ? $mock : $mock
@@ -400,6 +400,10 @@ mw.loader.register( [
                $module = new ResourceLoaderStartUpModule();
                $out = ltrim( $case['out'], "\n" );
 
+               // Disable log from getModuleRegistrations via MWExceptionHandler
+               // for case where getVersionHash() is expected to throw.
+               $this->setLogger( 'exception', new Psr\Log\NullLogger() );
+
                $this->assertEquals(
                        self::expandPlaceholders( $out ),
                        $module->getModuleRegistrations( $context ),