Completed
Push — 8.x-1.x ( c248cd...375743 )
by Janez
02:14
created

EntityEmbedUpdateHookTest::setDatabaseDumpFiles()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 6
rs 9.4285
1
<?php
2
3
namespace Drupal\entity_embed\Tests;
4
5
use Drupal\system\Tests\Update\UpdatePathTestBase;
6
7
/**
8
 * Tests the update hooks in entity_embed module.
9
 *
10
 * @group entity_embed
11
 */
12
class EntityEmbedUpdateHookTest extends UpdatePathTestBase {
13
14
  /**
15
   * Set database dump files to be used.
16
   */
17
  protected function setDatabaseDumpFiles() {
18
    $this->databaseDumpFiles = [
19
      DRUPAL_ROOT . '/core/modules/system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
20
      __DIR__ . '/../../tests/fixtures/update/entity_embed.update-hook-test.php',
21
    ];
22
  }
23
24
  /**
25
   * {@inheritdoc}
26
   */
27
  protected function doSelectionTest() {
28
    parent::doSelectionTest();
29
    $this->assertRaw('8002 -   Updates the default mode settings.');
30
  }
31
32
  /**
33
   * Tests entity_embed_update_8002().
34
   */
35
  public function testPostUpdate() {
36
    $this->runUpdates();
37
    $mode = $this->container->get('config.factory')
38
      ->get('entity_embed.settings')
39
      ->get('rendered_entity_mode');
40
    $this->assertTrue($mode, 'Render entity mode settings after update is correct.');
41
  }
42
43
}
44