function UpdateTestContribCase::testNoReleasesAvailable
7.x update.test | UpdateTestContribCase::testNoReleasesAvailable() |
Tests when there is no available release data for a contrib module.
File
- drupal-7.x/
modules/ update/ update.test, line 299 - This file contains tests for the Update Manager module.
Class
- UpdateTestContribCase
- Tests behavior related to handling updates to contributed modules and themes.
Code
function testNoReleasesAvailable() {
$system_info = array(
'#all' => array(
'version' => '7.0',
),
'aaa_update_test' => array(
'project' => 'aaa_update_test',
'version' => '7.x-1.0',
'hidden' => FALSE,
),
);
variable_set('update_test_system_info', $system_info);
$this->refreshUpdateStatus(array('drupal' => '0', 'aaa_update_test' => 'no-releases'));
$this->drupalGet('admin/reports/updates');
// Cannot use $this->standardTests() because we need to check for the
// 'No available releases found' string.
$this->assertRaw('<h3>' . t('Drupal core') . '</h3>');
$this->assertRaw(l(t('Drupal'), 'http://example.com/project/drupal'));
$this->assertText(t('Up to date'));
$this->assertRaw('<h3>' . t('Modules') . '</h3>');
$this->assertNoText(t('Update available'));
$this->assertText(t('No available releases found'));
$this->assertNoRaw(l(t('AAA Update test'), 'http://example.com/project/aaa_update_test'));
}