Tests concurrent importing of configuration.
function testImportLock() {
// Create updated configuration object.
$new_site_name = 'Config import test ' . $this
->randomString();
$this
->prepareSiteNameUpdate($new_site_name);
// Verify that there are configuration differences to import.
$this
->drupalGet('admin/config/development/sync');
$this
->assertNoText(t('There are no configuration changes.'));
// Acquire a fake-lock on the import mechanism.
lock()
->acquire('config_import');
// Attempt to import configuration and verify that an error message appears.
$this
->drupalPost(NULL, array(), t('Import all'));
$this
->assertUrl('admin/config/development/sync');
$this
->assertText(t('Another request may be synchronizing configuration already.'));
// Release the lock, just to keep testing sane.
lock()
->release('config_import');
// Verify site name has not changed.
$this
->assertNotEqual($new_site_name, config('system.site')
->get('name'));
}