+ /**
+ * Verify that exceptions in PHP for one module will not break others
+ * (stylesheet response).
+ *
+ * @covers ResourceLoader::makeModuleResponse
+ */
+ public function testMakeModuleResponseErrorCSS() {
+ $modules = [
+ 'foo' => self::getSimpleStyleModuleMock( '.foo{}' ),
+ 'ferry' => self::getFailFerryMock( 'getStyles' ),
+ 'bar' => self::getSimpleStyleModuleMock( '.bar{}' ),
+ ];
+ $rl = new EmptyResourceLoader();
+ $rl->register( $modules );
+ $context = $this->getResourceLoaderContext(
+ [
+ 'modules' => 'foo|ferry|bar',
+ 'only' => 'styles',
+ 'debug' => 'false',
+ ],
+ $rl
+ );
+
+ // Disable log from makeModuleResponse via outputErrorAndLog
+ $this->setLogger( 'exception', new Psr\Log\NullLogger() );
+
+ $response = $rl->makeModuleResponse( $context, $modules );
+ $errors = $rl->getErrors();
+
+ $this->assertCount( 2, $errors );
+ $this->assertRegExp( '/Ferry not found/', $errors[0] );
+ $this->assertRegExp( '/Problem.+\n\s*"ferry":\s*"error"/m', $errors[1] );
+ $this->assertEquals(
+ '.foo{}.bar{}',
+ $response
+ );
+ }