Merge branch '2021.03-rc' into copyright-2021

This commit is contained in:
Balázs Úr 2021-03-29 08:45:21 +02:00 committed by GitHub
commit befc2af504
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 41829 additions and 40547 deletions

View file

@ -319,4 +319,27 @@ class CacheTest extends MockedTest
self::assertEquals(23, $configCache->get('database', 'password'));
self::assertEmpty($configCache->get('database', 'username'));
}
/**
* Test the set() method with overrides
* @dataProvider dataTests
*/
public function testSetOverrides($data)
{
$configCache = new Cache();
$configCache->load($data, Cache::SOURCE_DB);
// test with wrong override
self::assertFalse($configCache->set('system', 'test', '1234567', Cache::SOURCE_FILE));
self::assertEquals($data['system']['test'], $configCache->get('system', 'test'));
// test with override (equal)
self::assertTrue($configCache->set('system', 'test', '8910', Cache::SOURCE_DB));
self::assertEquals('8910', $configCache->get('system', 'test'));
// test with override (over)
self::assertTrue($configCache->set('system', 'test', '111213', Cache::SOURCE_ENV));
self::assertEquals('111213', $configCache->get('system', 'test'));
}
}