Add @covers for various helper methods used by public methods, where the helper
methods actually contain most of the logic being tested in FileModuleTest.
I've changed these methods from protected to private (confirmed no usage)
to further pin down that their contract doesn't matter beyond making the
public methods work.
Change-Id: I2aef0d322b38bc3595e7d2c2339112b16fc66b8d
- * Helper method to gather file hashes for getDefinitionSummary.
- *
- * This function is context-sensitive, only computing hashes of files relevant to the
- * given language, skin, etc.
+ * Helper method for getDefinitionSummary.
*
* @see ResourceLoaderModule::getFileDependencies
* @param ResourceLoaderContext $context
* @return array
*/
*
* @see ResourceLoaderModule::getFileDependencies
* @param ResourceLoaderContext $context
* @return array
*/
- protected function getFileHashes( ResourceLoaderContext $context ) {
+ private function getFileHashes( ResourceLoaderContext $context ) {
$files = [];
// Flatten style files into $files
$files = [];
// Flatten style files into $files
- * Get a list of file paths for all scripts in this module, in order of proper execution.
+ * Get a list of script file paths for this module, in order of proper execution.
*
* @param ResourceLoaderContext $context
* @return array List of file paths
*/
*
* @param ResourceLoaderContext $context
* @return array List of file paths
*/
- protected function getScriptFiles( ResourceLoaderContext $context ) {
+ private function getScriptFiles( ResourceLoaderContext $context ) {
$files = array_merge(
$this->scripts,
$this->getLanguageScripts( $context->getLanguage() ),
$files = array_merge(
$this->scripts,
$this->getLanguageScripts( $context->getLanguage() ),
/**
* Get a list of file paths for all styles in this module, in order of proper inclusion.
*
/**
* Get a list of file paths for all styles in this module, in order of proper inclusion.
*
+ * This is considered a private method. Exposed for internal use by WebInstallerOutput.
+ *
+ * @private
* @param ResourceLoaderContext $context
* @return array List of file paths
*/
* @param ResourceLoaderContext $context
* @return array List of file paths
*/
- * Gets the contents of a list of JavaScript files.
+ * Get the contents of a list of JavaScript files. Helper for getScript().
*
* @param array $scripts List of file paths to scripts to read, remap and concetenate
*
* @param array $scripts List of file paths to scripts to read, remap and concetenate
* @return string Concatenated and remapped JavaScript data from $scripts
* @return string Concatenated and remapped JavaScript data from $scripts
- protected function readScriptFiles( array $scripts ) {
+ private function readScriptFiles( array $scripts ) {
if ( empty( $scripts ) ) {
return '';
}
if ( empty( $scripts ) ) {
return '';
}
- * Gets the contents of a list of CSS files.
+ * Get the contents of a list of CSS files.
+ *
+ * This is considered a private method. Exposed for internal use by WebInstallerOutput.
- * @param array $styles List of media type/list of file paths pairs, to read, remap and
- * concetenate
+ * @private
+ * @param array $styles Map of media type to file paths to read, remap, and concatenate
* @param bool $flip
* @param ResourceLoaderContext $context
* @param bool $flip
* @param ResourceLoaderContext $context
- *
- * @throws MWException
* @return array List of concatenated and remapped CSS data from $styles,
* keyed by media type
* @return array List of concatenated and remapped CSS data from $styles,
* keyed by media type
* @since 1.27 Calling this method without a ResourceLoaderContext instance
* is deprecated.
*/
* @since 1.27 Calling this method without a ResourceLoaderContext instance
* is deprecated.
*/
* @param ResourceLoaderContext $context
* @return array
*/
* @param ResourceLoaderContext $context
* @return array
*/
- protected function getFileHashes( ResourceLoaderContext $context ) {
+ private function getFileHashes( ResourceLoaderContext $context ) {
$this->loadFromDefinition();
$files = [];
foreach ( $this->getImages( $context ) as $name => $image ) {
$this->loadFromDefinition();
$files = [];
foreach ( $this->getImages( $context ) as $name => $image ) {
/**
* @covers ResourceLoaderFileModule::getScript
/**
* @covers ResourceLoaderFileModule::getScript
+ * @covers ResourceLoaderFileModule::getScriptFiles
+ * @covers ResourceLoaderFileModule::readScriptFiles
*/
public function testGetScript() {
$module = new ResourceLoaderFileModule( [
*/
public function testGetScript() {
$module = new ResourceLoaderFileModule( [
*
* @covers ResourceLoaderFileModule::getStyles
* @covers ResourceLoaderFileModule::getStyleFiles
*
* @covers ResourceLoaderFileModule::getStyles
* @covers ResourceLoaderFileModule::getStyleFiles
+ * @covers ResourceLoaderFileModule::readStyleFiles
+ * @covers ResourceLoaderFileModule::readStyleFile
*/
public function testMixedCssAnnotations() {
$basePath = __DIR__ . '/../../data/css';
*/
public function testMixedCssAnnotations() {
$basePath = __DIR__ . '/../../data/css';
/**
* @covers ResourceLoaderFileModule::getDefinitionSummary
/**
* @covers ResourceLoaderFileModule::getDefinitionSummary
+ * @covers ResourceLoaderFileModule::getFileHashes
*/
public function testGetVersionHash() {
$context = $this->getResourceLoaderContext();
*/
public function testGetVersionHash() {
$context = $this->getResourceLoaderContext();