$url = $match['file'] . $match['query'];
$file = $local . $match['file'];
if (
- !CSSMin::isRemoteUrl( $url ) && !CSSMin::isLocalUrl( $url )
+ !self::isRemoteUrl( $url ) && !self::isLocalUrl( $url )
&& file_exists( $file )
) {
$mimeTypes[ CSSMin::getMimeType( $file ) ] = true;
/**
* Is this CSS rule referencing a remote URL?
*
- * @private Until we require PHP 5.5 and we can access self:: from closures.
* @param string $maybeUrl
* @return bool
*/
- public static function isRemoteUrl( $maybeUrl ) {
+ protected static function isRemoteUrl( $maybeUrl ) {
if ( substr( $maybeUrl, 0, 2 ) === '//' || parse_url( $maybeUrl, PHP_URL_SCHEME ) ) {
return true;
}
/**
* Is this CSS rule referencing a local URL?
*
- * @private Until we require PHP 5.5 and we can access self:: from closures.
* @param string $maybeUrl
* @return bool
*/
- public static function isLocalUrl( $maybeUrl ) {
+ protected static function isLocalUrl( $maybeUrl ) {
if ( $maybeUrl !== '' && $maybeUrl[0] === '/' && !self::isRemoteUrl( $maybeUrl ) ) {
return true;
}
* @cover CSSMin::isRemoteUrl
*/
public function testIsRemoteUrl( $expect, $url ) {
- $this->assertEquals( CSSMin::isRemoteUrl( $url ), $expect );
+ $this->assertEquals( CSSMinTestable::isRemoteUrl( $url ), $expect );
}
public static function provideIsLocalUrls() {
* @cover CSSMin::isLocalUrl
*/
public function testIsLocalUrl( $expect, $url ) {
- $this->assertEquals( CSSMin::isLocalUrl( $url ), $expect );
+ $this->assertEquals( CSSMinTestable::isLocalUrl( $url ), $expect );
}
public static function provideRemapRemappingCases() {
];
}
}
+
+class CSSMinTestable extends CSSMin {
+ // Make some protected methods public
+ public static function isRemoteUrl( $maybeUrl ) {
+ return parent::isRemoteUrl( $maybeUrl );
+ }
+ public static function isLocalUrl( $maybeUrl ) {
+ return parent::isLocalUrl( $maybeUrl );
+ }
+}