MediaWiki REL1_31
EtcdConfigTest Class Reference
Inheritance diagram for EtcdConfigTest:
Collaboration diagram for EtcdConfigTest:

Public Member Functions

 testConstructCacheObj ()
 EtcdConfig::__construct.
 
 testConstructCacheSpec ()
 EtcdConfig::__construct.
 
 testFetchFromServer (array $httpResponse, array $expected)
 EtcdConfig::fetchAllFromEtcdServer EtcdConfig::unserialize EtcdConfig::parseResponse EtcdConfig::parseDirectory EtcdConfigParseError provideFetchFromServer.
 
 testGetKnown ()
 EtcdConfig::__construct EtcdConfig::get.
 
 testGetModifiedIndex ()
 EtcdConfig::getModifiedIndex.
 
 testGetUnknown ()
 EtcdConfig::get.
 
 testHasKnown ()
 EtcdConfig::has.
 
 testHasUnknown ()
 EtcdConfig::has.
 
 testLoadCacheExpiredLockFetchFails ()
 EtcdConfig::load.
 
 testLoadCacheExpiredLockFetchSucceeded ()
 EtcdConfig::load.
 
 testLoadCacheExpiredNoLock ()
 EtcdConfig::load.
 
 testLoadCacheHit ()
 EtcdConfig::load.
 
 testLoadCacheMiss ()
 Test matrix.
 
 testLoadCacheMissBackendError ()
 EtcdConfig::load.
 
 testLoadCacheMissWithoutLock ()
 EtcdConfig::load.
 
 testLoadProcessCacheHit ()
 EtcdConfig::load.
 

Static Public Member Functions

static provideFetchFromServer ()
 

Private Member Functions

 createConfigMock (array $options=[])
 
 createSimpleConfigMock (array $config, $index=0)
 

Static Private Member Functions

static createEtcdResponse (array $response)
 

Detailed Description

Definition at line 5 of file EtcdConfigTest.php.

Member Function Documentation

◆ createConfigMock()

◆ createEtcdResponse()

static EtcdConfigTest::createEtcdResponse ( array  $response)
staticprivate

Definition at line 21 of file EtcdConfigTest.php.

References $response.

Referenced by provideFetchFromServer().

◆ createSimpleConfigMock()

EtcdConfigTest::createSimpleConfigMock ( array  $config,
  $index = 0 
)
private

◆ provideFetchFromServer()

static EtcdConfigTest::provideFetchFromServer ( )
static

Definition at line 393 of file EtcdConfigTest.php.

References createEtcdResponse().

◆ testConstructCacheObj()

EtcdConfigTest::testConstructCacheObj ( )

EtcdConfig::__construct.

Definition at line 97 of file EtcdConfigTest.php.

References $cache, and createConfigMock().

◆ testConstructCacheSpec()

EtcdConfigTest::testConstructCacheSpec ( )

EtcdConfig::__construct.

Definition at line 115 of file EtcdConfigTest.php.

References createConfigMock().

◆ testFetchFromServer()

EtcdConfigTest::testFetchFromServer ( array  $httpResponse,
array  $expected 
)

◆ testGetKnown()

EtcdConfigTest::testGetKnown ( )

◆ testGetModifiedIndex()

EtcdConfigTest::testGetModifiedIndex ( )

◆ testGetUnknown()

EtcdConfigTest::testGetUnknown ( )

EtcdConfig::get.

Definition at line 75 of file EtcdConfigTest.php.

References createSimpleConfigMock().

◆ testHasKnown()

EtcdConfigTest::testHasKnown ( )

EtcdConfig::has.

Definition at line 44 of file EtcdConfigTest.php.

References createSimpleConfigMock().

◆ testHasUnknown()

EtcdConfigTest::testHasUnknown ( )

EtcdConfig::has.

Definition at line 65 of file EtcdConfigTest.php.

References createSimpleConfigMock().

◆ testLoadCacheExpiredLockFetchFails()

EtcdConfigTest::testLoadCacheExpiredLockFetchFails ( )

EtcdConfig::load.

Definition at line 338 of file EtcdConfigTest.php.

References $cache, and createConfigMock().

◆ testLoadCacheExpiredLockFetchSucceeded()

EtcdConfigTest::testLoadCacheExpiredLockFetchSucceeded ( )

EtcdConfig::load.

Definition at line 308 of file EtcdConfigTest.php.

References $cache, and createConfigMock().

◆ testLoadCacheExpiredNoLock()

EtcdConfigTest::testLoadCacheExpiredNoLock ( )

EtcdConfig::load.

Definition at line 368 of file EtcdConfigTest.php.

References $cache, and createConfigMock().

◆ testLoadCacheHit()

EtcdConfigTest::testLoadCacheHit ( )

EtcdConfig::load.

Definition at line 255 of file EtcdConfigTest.php.

References $cache, and createConfigMock().

◆ testLoadCacheMiss()

EtcdConfigTest::testLoadCacheMiss ( )

Test matrix.

  • [x] Cache miss Result: Fetched value > cache miss | gets lock | backend succeeds
  • [x] Cache miss with backend error Result: ConfigException > cache miss | gets lock | backend error (no retry)
  • [x] Cache hit after retry Result: Cached value (populated by process holding lock) > cache miss | no lock | cache retry
  • [x] Cache hit Result: Cached value > cache hit
  • [x] Process cache hit Result: Cached value > process cache hit
  • [x] Cache expired Result: Fetched value > cache expired | gets lock | backend succeeds
  • [x] Cache expired with backend failure Result: Cached value (stale) > cache expired | gets lock | backend fails (allows retry)
  • [x] Cache expired and no lock Result: Cached value (stale) > cache expired | no lock

Other notable scenarios:

  • [ ] Cache miss with backend retry Result: Fetched value > cache expired | gets lock | backend failure (allows retry) EtcdConfig::load

Definition at line 171 of file EtcdConfigTest.php.

References $cache, and createConfigMock().

◆ testLoadCacheMissBackendError()

EtcdConfigTest::testLoadCacheMissBackendError ( )

EtcdConfig::load.

Definition at line 197 of file EtcdConfigTest.php.

References $cache, and createConfigMock().

◆ testLoadCacheMissWithoutLock()

EtcdConfigTest::testLoadCacheMissWithoutLock ( )

EtcdConfig::load.

Definition at line 223 of file EtcdConfigTest.php.

References $cache, and createConfigMock().

◆ testLoadProcessCacheHit()

EtcdConfigTest::testLoadProcessCacheHit ( )

EtcdConfig::load.

Definition at line 281 of file EtcdConfigTest.php.

References $cache, and createConfigMock().


The documentation for this class was generated from the following file: