You are here

public function EntityClassFormatterTest::testStringFieldClass in Entity Class Formatter 8

File

tests/src/Functional/EntityClassFormatterTest.php, line 95

Class

EntityClassFormatterTest
@group entity_class_formatter

Namespace

Drupal\Tests\entity_class_formatter\Functional

Code

public function testStringFieldClass() {
  $field_config = $this
    ->createField('string');
  $entity = $this
    ->drupalCreateNode([
    $field_config
      ->getName() => [
      0 => [
        'value' => self::STRING_CLASS,
      ],
    ],
  ]);
  $entity
    ->save();
  $this
    ->drupalGet($entity
    ->toUrl());
  $assert_session = $this
    ->assertSession();
  $class = self::CLASS_PREFIX . self::STRING_CLASS . self::CLASS_SUFFIX;
  $assert_session
    ->elementExists('css', '.node.' . $class);
}