<?php
namespace Drupal\system\Tests\Upgrade;
class BareStandardUpgradePathTest extends UpgradePathTestBase {
public static function getInfo() {
return array(
'name' => 'Basic standard + all profile upgrade path, bare database',
'description' => 'Basic upgrade path tests for a standard profile install with all enabled modules and a bare database.',
'group' => 'Upgrade path',
);
}
public function setUp() {
$this->databaseDumpFiles = array(
drupal_get_path('module', 'system') . '/tests/upgrade/drupal-7.bare.standard_all.database.php.gz',
);
parent::setUp();
}
public function testBasicStandardUpgrade() {
$this
->assertTrue($this
->performUpgrade(), 'The upgrade was completed successfully.');
$this
->drupalGet('');
$this
->assertResponse(200);
$this
->drupalGet('user');
$this
->clickLink(t('Edit'));
$this
->assertEqual($this
->getUrl(), url('user/1/edit', array(
'absolute' => TRUE,
)), 'We are still logged in as admin at the end of the upgrade.');
$this
->drupalLogout();
$this
->drupalLogin((object) array(
'uid' => 1,
'name' => 'admin',
'pass_raw' => 'drupal',
));
$this
->drupalLogout();
$this
->drupalLogin((object) array(
'uid' => 1,
'name' => 'admin',
'pass_raw' => 'drupal',
));
$this
->assertText('drupal', 'The site name is correctly displayed.');
$this
->drupalGet('admin');
$this
->assertText(t('Content'));
$this
->assertText(t('Appearance'));
$this
->assertText(t('People'));
$this
->assertText(t('Configuration'));
$this
->assertText(t('Reports'));
$this
->assertText(t('Structure'));
$this
->assertText(t('Extend'));
$result = db_query('SELECT COUNT(*) FROM {menu_links} WHERE link_path = :user_autocomplete', array(
':user_autocomplete' => 'user/autocomplete',
))
->fetchField();
$this
->assertFalse($result, 'No {menu_links} entry exists for user/autocomplete');
$blog_type = node_type_load('blog');
$this
->assertEqual($blog_type->module, 'node', "Content type 'blog' has been reassigned from the blog module to the node module.");
$this
->assertEqual($blog_type->base, 'node_content', "The base string used to construct callbacks corresponding to content type 'Blog' has been reassigned to 'node_content'.");
}
}