Verified Commit 9d3c52dd authored by Lauri Timmanee's avatar Lauri Timmanee
Browse files

Issue #3372972 by Wim Leers, phenaproxima, NickDickinsonWilde, smustgrave: Fix...

Issue #3372972 by Wim Leers, phenaproxima, NickDickinsonWilde, smustgrave: Fix all type: machine_name constraint violations in tests
parent 919cebfc
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -70,9 +70,6 @@ public function checkConfigSchema(TypedConfigManagerInterface $typed_config, $co
      // @see \Drupal\Core\Plugin\Plugin\Validation\Constraint\PluginExistsConstraint::$unknownPluginMessage
      // @todo Remove this in https://www.drupal.org/project/drupal/issues/3362457
      "The '.*' plugin does not exist.",
      // @see "machine_name" in core.data_types.schema.yml
      // @todo Remove this in https://www.drupal.org/project/drupal/issues/3372972
      "The <em class=\"placeholder\">.*<\/em> machine name is not valid.",
    ];
    $filtered_violations = array_filter(
      iterator_to_array($violations),
+5 −5
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ protected function setUp(): void {
      ->set('slogan', 'Community plumbing')
      ->save();
    // Add the system branding block to the page.
    $this->drupalPlaceBlock('system_branding_block', ['region' => 'header', 'id' => 'site-branding']);
    $this->drupalPlaceBlock('system_branding_block', ['region' => 'header', 'id' => 'site_branding']);
  }

  /**
@@ -64,7 +64,7 @@ public function testSystemBrandingSettings() {
    $this->assertSession()->responseNotContains('<script>alert("Community carpentry");</script>');

    // Turn just the logo off.
    $this->config('block.block.site-branding')
    $this->config('block.block.site_branding')
      ->set('settings.use_site_logo', 0)
      ->save();
    $this->drupalGet('');
@@ -77,7 +77,7 @@ public function testSystemBrandingSettings() {
    $this->assertSession()->responseHeaderContains('X-Drupal-Cache-Tags', 'config:system.site');

    // Turn just the site name off.
    $this->config('block.block.site-branding')
    $this->config('block.block.site_branding')
      ->set('settings.use_site_logo', 1)
      ->set('settings.use_site_name', 0)
      ->save();
@@ -91,7 +91,7 @@ public function testSystemBrandingSettings() {
    $this->assertSession()->responseHeaderContains('X-Drupal-Cache-Tags', 'config:system.site');

    // Turn just the site slogan off.
    $this->config('block.block.site-branding')
    $this->config('block.block.site_branding')
      ->set('settings.use_site_name', 1)
      ->set('settings.use_site_slogan', 0)
      ->save();
@@ -104,7 +104,7 @@ public function testSystemBrandingSettings() {
    $this->assertSession()->responseHeaderContains('X-Drupal-Cache-Tags', 'config:system.site');

    // Turn the site name and the site slogan off.
    $this->config('block.block.site-branding')
    $this->config('block.block.site_branding')
      ->set('settings.use_site_name', 0)
      ->set('settings.use_site_slogan', 0)
      ->save();
+5 −5
Original line number Diff line number Diff line
@@ -477,7 +477,7 @@ public function testBlockCacheTags() {
    $this->assertSession()->responseHeaderEquals('X-Drupal-Cache', 'HIT');

    // Place the "Powered by Drupal" block another time; verify a cache miss.
    $this->drupalPlaceBlock('system_powered_by_block', ['id' => 'powered-2']);
    $this->drupalPlaceBlock('system_powered_by_block', ['id' => 'powered_2']);
    $this->drupalGet('<front>');
    $this->assertSession()->responseHeaderEquals('X-Drupal-Cache', 'MISS');

@@ -491,7 +491,7 @@ public function testBlockCacheTags() {
      'config:block_list',
      'block_view',
      'config:block.block.powered',
      'config:block.block.powered-2',
      'config:block.block.powered_2',
      'config:user.role.anonymous',
      'http_response',
      'rendered',
@@ -509,12 +509,12 @@ public function testBlockCacheTags() {
    $this->assertSame($expected_cache_tags, $cache_entry->tags);
    $expected_cache_tags = [
      'block_view',
      'config:block.block.powered-2',
      'config:block.block.powered_2',
      'rendered',
    ];
    sort($expected_cache_tags);
    $keys = \Drupal::service('cache_contexts_manager')->convertTokensToKeys(['languages:language_interface', 'theme', 'user.permissions'])->getKeys();
    $cache_entry = \Drupal::cache('render')->get('entity_view:block:powered-2:' . implode(':', $keys));
    $cache_entry = \Drupal::cache('render')->get('entity_view:block:powered_2:' . implode(':', $keys));
    $this->assertSame($expected_cache_tags, $cache_entry->tags);

    // Now we should have a cache hit again.
@@ -524,7 +524,7 @@ public function testBlockCacheTags() {
    // Delete the "Powered by Drupal" blocks; verify a cache miss.
    $block_storage = \Drupal::entityTypeManager()->getStorage('block');
    $block_storage->load('powered')->delete();
    $block_storage->load('powered-2')->delete();
    $block_storage->load('powered_2')->delete();
    $this->drupalGet('<front>');
    $this->assertSession()->responseHeaderEquals('X-Drupal-Cache', 'MISS');
  }
+0 −1
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@ class BlockContentWizardTest extends BlockContentTestBase {
  protected function setUp(): void {
    parent::setUp();
    $this->drupalLogin($this->drupalCreateUser(['administer views']));
    $this->createBlockContentType('Basic block');
  }

  /**
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ dependencies:
  enforced:
    module:
      - config_test
id: exclude_test
id: exclude-test
label: Test
description: 'Test menu depending on config_test'
locked: true
Loading