1 update.test UpdateCoreTestCase::testUpdateCheckingEnabled()

Tests _update_checking_enabled() returns the expected value during tests.

File

core/modules/update/tests/update.test, line 208
This file contains tests for the Update Manager module.

Class

UpdateCoreTestCase

Code

function testUpdateCheckingEnabled() {
  $config = config('update.settings');
  $this->assertEqual($config->get('update_url'), '', 'No update server specified in the default installation.');
  $this->assertFalse(_update_checking_enabled(), 'Update checking is not enabled when using the default server.');

  $this->backdropGet('admin/reports/updates/check');
  $this->assertText(t('Update checking is disabled on this site.'));

  $config->set('update_url', url('update-test', array('absolute' => TRUE)))->save();
  $config->save();

  $this->assertTrue(_update_checking_enabled(), 'Update checking enabled during tests when using a local host update URL.');

  $this->backdropGet('admin/reports/updates/check');
  $this->assertNoText(t('Update checking is disabled on this site.'));
}