From: Timo Tijhof Date: Fri, 6 Mar 2015 02:26:44 +0000 (+0100) Subject: resourceloader: Call setName() in test suite before calling getStyles() X-Git-Tag: 1.31.0-rc.0~12167^2 X-Git-Url: http://git.cyclocoop.org/%22.%28%24lien.?a=commitdiff_plain;h=54473cbb6deaf3c8b2089a3a9a995b067e272151;p=lhc%2Fweb%2Fwiklou.git resourceloader: Call setName() in test suite before calling getStyles() This caused a database error due to NULL being inserted as name, which is illegal. > Function: DatabaseSqlite::replace/single-row > NOT NULL constraint failed: unittest_module_deps.md_module > Stack trace: > #3 includes/resourceloader/ResourceLoaderFileModule.php(420): DatabaseSqlite->replace() > #4 tests/phpunit/includes/resourceloader/ResourceLoaderTest.php(88): ResourceLoaderFileModule->getStyles() > #5 (): ResourceLoaderTest->testLessFileCompilation() This test shouldn't be trigggering database updates, but that's for a later change to stub out or refactor. Bug: T91567 Change-Id: Ic451bd41e2ffc188d2efd6b7ce61b03b9de61296 --- diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderTest.php index 4fc7378a8a..5d83239a29 100644 --- a/tests/phpunit/includes/resourceloader/ResourceLoaderTest.php +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderTest.php @@ -85,6 +85,7 @@ class ResourceLoaderTest extends ResourceLoaderTestCase { 'localBasePath' => $basePath, 'styles' => array( 'styles.less' ), ) ); + $module->setName( 'test.less' ); $styles = $module->getStyles( $context ); $this->assertStringEqualsFile( $basePath . '/styles.css', $styles['all'] ); }