SiteBrandingConvertedIntoBlockUpdateTest.php in Zircon Profile 8
File
core/modules/system/src/Tests/Update/SiteBrandingConvertedIntoBlockUpdateTest.php
View source
<?php
namespace Drupal\system\Tests\Update;
class SiteBrandingConvertedIntoBlockUpdateTest extends UpdatePathTestBase {
protected function setDatabaseDumpFiles() {
$this->databaseDumpFiles = [
__DIR__ . '/../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
__DIR__ . '/../../../../system/tests/fixtures/update/drupal-8.site-branding-into-block-2005546.php',
];
}
protected function setUp() {
parent::setUp();
$theme_handler = \Drupal::service('theme_handler');
$theme_handler
->refreshInfo();
}
public function testUpdateHookN() {
$this
->runUpdates();
$block_storage = \Drupal::entityManager()
->getStorage('block');
$this
->assertRaw('Because your site has custom theme(s) installed, we had to set the branding block into the content region. Please manually review the block configuration and remove the site name, slogan, and logo variables from your templates.');
\Drupal::state()
->set('system.maintenance_mode', FALSE);
$this
->drupalLogin($this->rootUser);
$this
->drupalGet('/node');
$this
->assertRaw('site-branding__logo');
$this
->assertRaw('site-branding__name');
$this
->assertNoRaw('site-branding__slogan');
$this
->drupalGet('admin/structure/block/list/bartik');
$config_storage = \Drupal::service('config.storage');
$this
->assertTrue($config_storage
->exists('block.block.test_theme_branding'), 'Site branding block has been created for the custom theme.');
}
}