function FilterFormatRepositoryTest::testGetDefaultFormatWithAccount

Same name and namespace in other branches
  1. main core/modules/filter/tests/src/Kernel/FilterFormatRepositoryTest.php \Drupal\Tests\filter\Kernel\FilterFormatRepositoryTest::testGetDefaultFormatWithAccount()

@legacy-covers ::getDefaultFormat

File

core/modules/filter/tests/src/Kernel/FilterFormatRepositoryTest.php, line 93

Class

FilterFormatRepositoryTest
Tests the Drupal\filter\FilterFormatRepositoryInterface service.

Namespace

Drupal\Tests\filter\Kernel

Code

public function testGetDefaultFormatWithAccount() : void {
  $account = $this->createUser([
    'use text format foo',
    'use text format bar',
  ]);
  $this->assertSame('bar', $this->repository
    ->getDefaultFormat($account)
    ->id());
  $this->assertSame('plain_text', $this->repository
    ->getDefaultFormat()
    ->id());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.