public function testGetStylesTryCatchExceptionIsThrownByLessParser() { $resourceLoaderContext = $this->getMockBuilder('\\ResourceLoaderContext')->disableOriginalConstructor()->getMock(); $options = array('external styles' => array('Foo' => 'bar')); $instance = new ResourceLoaderBootstrapModule($options); $instance->setCache(new HashBagOStuff()); $result = $instance->getStyles($resourceLoaderContext); $this->assertContains('LESS compile error', $result['all']); }
public function testStylesCompile() { $setupAfterCache = new SetupAfterCache(BootstrapManager::getInstance(), $GLOBALS); $setupAfterCache->process(); $resourceLoaderContext = $this->getMockBuilder('\\ResourceLoaderContext')->disableOriginalConstructor()->getMock(); $module = new ResourceLoaderBootstrapModule($GLOBALS['wgResourceModules']['ext.bootstrap.styles']); $module->setCache(new HashBagOStuff()); $styles = $module->getStyles($resourceLoaderContext); $css = CSSMin::minify($styles['all']); $this->assertNotEquals('', $css); }