MediaWiki  1.30.0
EtcConfigTest Class Reference
Inheritance diagram for EtcConfigTest:
Collaboration diagram for EtcConfigTest:

Public Member Functions

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

Static Public Member Functions

static provideFetchFromServer ()
 

Private Member Functions

 createConfigMock (array $options=[])
 
 createSimpleConfigMock (array $config)
 

Detailed Description

Definition at line 5 of file EtcdConfigTest.php.

Member Function Documentation

◆ createConfigMock()

◆ createSimpleConfigMock()

EtcConfigTest::createSimpleConfigMock ( array  $config)
private

Definition at line 18 of file EtcdConfigTest.php.

References createConfigMock().

Referenced by testGetKnown(), testGetUnknown(), testHasKnown(), and testHasUnknown().

◆ provideFetchFromServer()

static EtcConfigTest::provideFetchFromServer ( )
static

Definition at line 365 of file EtcdConfigTest.php.

References false, and true.

◆ testConstructCacheObj()

EtcConfigTest::testConstructCacheObj ( )

EtcdConfig::__construct.

Definition at line 74 of file EtcdConfigTest.php.

References $cache, class, and createConfigMock().

◆ testConstructCacheSpec()

EtcConfigTest::testConstructCacheSpec ( )

EtcdConfig::__construct.

Definition at line 91 of file EtcdConfigTest.php.

References class, and createConfigMock().

◆ testFetchFromServer()

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

◆ testGetKnown()

EtcConfigTest::testGetKnown ( )

◆ testGetUnknown()

EtcConfigTest::testGetUnknown ( )

EtcdConfig::get.

Definition at line 63 of file EtcdConfigTest.php.

References class, and createSimpleConfigMock().

◆ testHasKnown()

EtcConfigTest::testHasKnown ( )

EtcdConfig::has.

Definition at line 32 of file EtcdConfigTest.php.

References createSimpleConfigMock().

◆ testHasUnknown()

EtcConfigTest::testHasUnknown ( )

EtcdConfig::has.

Definition at line 53 of file EtcdConfigTest.php.

References createSimpleConfigMock().

◆ testLoadCacheExpiredLockFetchFails()

EtcConfigTest::testLoadCacheExpiredLockFetchFails ( )

EtcdConfig::load.

Definition at line 312 of file EtcdConfigTest.php.

References $cache, class, and createConfigMock().

◆ testLoadCacheExpiredLockFetchSucceeded()

EtcConfigTest::testLoadCacheExpiredLockFetchSucceeded ( )

EtcdConfig::load.

Definition at line 283 of file EtcdConfigTest.php.

References $cache, class, and createConfigMock().

◆ testLoadCacheExpiredNoLock()

EtcConfigTest::testLoadCacheExpiredNoLock ( )

EtcdConfig::load.

Definition at line 341 of file EtcdConfigTest.php.

References $cache, class, and createConfigMock().

◆ testLoadCacheHit()

EtcConfigTest::testLoadCacheHit ( )

EtcdConfig::load.

Definition at line 232 of file EtcdConfigTest.php.

References $cache, class, and createConfigMock().

◆ testLoadCacheMiss()

EtcConfigTest::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 150 of file EtcdConfigTest.php.

References $cache, class, and createConfigMock().

◆ testLoadCacheMissBackendError()

EtcConfigTest::testLoadCacheMissBackendError ( )

EtcdConfig::load.

Definition at line 175 of file EtcdConfigTest.php.

References $cache, class, and createConfigMock().

◆ testLoadCacheMissWithoutLock()

EtcConfigTest::testLoadCacheMissWithoutLock ( )

EtcdConfig::load.

Definition at line 201 of file EtcdConfigTest.php.

References $cache, class, and createConfigMock().

◆ testLoadProcessCacheHit()

EtcConfigTest::testLoadProcessCacheHit ( )

EtcdConfig::load.

Definition at line 257 of file EtcdConfigTest.php.

References $cache, class, and createConfigMock().


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