Browse Source
Merge pull request #30582 from nextcloud/fix/streamline_clearing_static_state
Streamline reseting of private static properties
pull/30533/head
Louis
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
2 additions and
12 deletions
-
lib/public/Util.php
-
tests/lib/UtilTest.php
|
|
|
@ -597,14 +597,4 @@ class Util { |
|
|
|
} |
|
|
|
return $temp; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Reset scripts and scriptDeps to empty arrays. |
|
|
|
* Only used in tests. |
|
|
|
* @since 24.0.0 |
|
|
|
*/ |
|
|
|
public static function clearScriptsState() { |
|
|
|
self::$scripts = []; |
|
|
|
self::$scriptDeps = []; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -224,17 +224,17 @@ class UtilTest extends \Test\TestCase { |
|
|
|
parent::setUp(); |
|
|
|
|
|
|
|
\OC_Util::$scripts = []; |
|
|
|
\OCP\Util::clearScriptsState(); |
|
|
|
\OC_Util::$styles = []; |
|
|
|
self::invokePrivate(\OCP\Util::class, 'scripts', [[]]); |
|
|
|
self::invokePrivate(\OCP\Util::class, 'scriptDeps', [[]]); |
|
|
|
} |
|
|
|
protected function tearDown(): void { |
|
|
|
parent::tearDown(); |
|
|
|
|
|
|
|
\OC_Util::$scripts = []; |
|
|
|
\OCP\Util::clearScriptsState(); |
|
|
|
\OC_Util::$styles = []; |
|
|
|
self::invokePrivate(\OCP\Util::class, 'scripts', [[]]); |
|
|
|
self::invokePrivate(\OCP\Util::class, 'scriptDeps', [[]]); |
|
|
|
} |
|
|
|
|
|
|
|
public function testAddScript() { |
|
|
|
|