createMock() does the same, but is much easier to read. A small difference is that some of the replacements made in this patch didn't use disableOriginalConstructor() before. In case this was relevant we should see the respective test fail. If not we can save some CPU cycles and skip these constructors. Change-Id: Ib98fb06e0fe753b7a53cb087a47e1159515a8ad5
18 lines
451 B
PHP
18 lines
451 B
PHP
<?php
|
|
|
|
class WebInstallerOutputTest extends MediaWikiIntegrationTestCase {
|
|
/**
|
|
* @covers WebInstallerOutput::getCSS
|
|
*/
|
|
public function testGetCSS() {
|
|
$_SERVER['DOCUMENT_ROOT'] = __DIR__ . '../../../';
|
|
$installer = $this->createMock( WebInstaller::class );
|
|
$out = new WebInstallerOutput( $installer );
|
|
$css = $out->getCSS();
|
|
$this->assertStringContainsString(
|
|
'#content {',
|
|
$css,
|
|
'CSS for installer can be generated'
|
|
);
|
|
}
|
|
}
|