From 400e4848ec058332b7d48637e1d0f794c1d4281d Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sun, 16 Mar 2014 12:28:18 -0700 Subject: [PATCH] Moved ProcessCacheLRU to /libs Change-Id: I7052d04d9847f0310c1e62bd66365c813fddeab5 --- includes/AutoLoader.php | 2 +- includes/{cache => libs}/ProcessCacheLRU.php | 4 ++-- .../phpunit/includes/{cache => libs}/ProcessCacheLRUTest.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename includes/{cache => libs}/ProcessCacheLRU.php (95%) rename tests/phpunit/includes/{cache => libs}/ProcessCacheLRUTest.php (99%) diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php index b290e8d51f..c627da16fe 100644 --- a/includes/AutoLoader.php +++ b/includes/AutoLoader.php @@ -386,7 +386,6 @@ $wgAutoloadLocalClasses = array( 'MapCacheLRU' => 'includes/cache/MapCacheLRU.php', 'MessageCache' => 'includes/cache/MessageCache.php', 'ObjectFileCache' => 'includes/cache/ObjectFileCache.php', - 'ProcessCacheLRU' => 'includes/cache/ProcessCacheLRU.php', 'ResourceFileCache' => 'includes/cache/ResourceFileCache.php', # includes/changes @@ -709,6 +708,7 @@ $wgAutoloadLocalClasses = array( 'JSTokenizer' => 'includes/libs/jsminplus.php', 'MultiHttpClient' => 'includes/libs/MultiHttpClient.php', 'MWMessagePack' => 'includes/libs/MWMessagePack.php', + 'ProcessCacheLRU' => 'includes/libs/ProcessCacheLRU.php', 'RunningStat' => 'includes/libs/RunningStat.php', 'ScopedCallback' => 'includes/libs/ScopedCallback.php', 'ScopedPHPTimeout' => 'includes/libs/ScopedPHPTimeout.php', diff --git a/includes/cache/ProcessCacheLRU.php b/includes/libs/ProcessCacheLRU.php similarity index 95% rename from includes/cache/ProcessCacheLRU.php rename to includes/libs/ProcessCacheLRU.php index 786d74acec..f2d9f42aba 100644 --- a/includes/cache/ProcessCacheLRU.php +++ b/includes/libs/ProcessCacheLRU.php @@ -35,11 +35,11 @@ class ProcessCacheLRU { /** * @param $maxKeys integer Maximum number of entries allowed (min 1). - * @throws MWException When $maxCacheKeys is not an int or =< 0. + * @throws UnexpectedValueException When $maxCacheKeys is not an int or =< 0. */ public function __construct( $maxKeys ) { if ( !is_int( $maxKeys ) || $maxKeys < 1 ) { - throw new MWException( __METHOD__ . " must be given an integer and >= 1" ); + throw new UnexpectedValueException( __METHOD__ . " must be given an integer >= 1" ); } $this->maxCacheKeys = $maxKeys; } diff --git a/tests/phpunit/includes/cache/ProcessCacheLRUTest.php b/tests/phpunit/includes/libs/ProcessCacheLRUTest.php similarity index 99% rename from tests/phpunit/includes/cache/ProcessCacheLRUTest.php rename to tests/phpunit/includes/libs/ProcessCacheLRUTest.php index d3793d8343..3eae810c4d 100644 --- a/tests/phpunit/includes/cache/ProcessCacheLRUTest.php +++ b/tests/phpunit/includes/libs/ProcessCacheLRUTest.php @@ -68,7 +68,7 @@ class ProcessCacheLRUTest extends MediaWikiTestCase { /** * @dataProvider provideInvalidConstructorArg - * @expectedException MWException + * @expectedException UnexpectedValueException */ public function testConstructorGivenInvalidValue( $maxSize ) { new ProcessCacheLRUTestable( $maxSize ); -- 2.20.1