Commit 3fc999a8 authored by catch's avatar catch
Browse files

Issue #3240247 by alexpott, daffie: \Drupal\filter\Entity\FilterFormat::$name...

Issue #3240247 by alexpott, daffie: \Drupal\filter\Entity\FilterFormat::$name with a NULL value causes deprecations in PHP 8.1
parent a4269698
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ protected function setUp(): void {
    // Create format without filters to prevent filtering.
    FilterFormat::create([
      'format' => 'no_filters',
      'name' => 'No filters',
      'filters' => [],
    ])->save();

+1 −0
Original line number Diff line number Diff line
@@ -206,6 +206,7 @@ public function preSave(EntityStorageInterface $storage) {

    parent::preSave($storage);

    assert(is_string($this->label()), 'Filter format label is expected to be a string.');
    $this->name = trim($this->label());
  }

+1 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ class FilterHtmlTest extends WebDriverTestBase {
  public function testTableTags() {
    FilterFormat::create([
      'format' => 'some_html',
      'name' => 'Some HTML',
      'filters' => [
        'filter_html' => [
          'status' => 1,
+1 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ public function testBuildForm() {
      'filters' => [
        'media_embed' => ['status' => TRUE],
      ],
      'name' => 'Media embed on',
    ]);

    $editor = $this->prophesize(EditorInterface::class);
+5 −0
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@ public function testLongSentence() {
  public function testLength() {
    FilterFormat::create([
      'format' => 'autop',
      'name' => 'Autop',
      'filters' => [
        'filter_autop' => [
          'status' => 1,
@@ -83,6 +84,7 @@ public function testLength() {
    ])->save();
    FilterFormat::create([
      'format' => 'autop_correct',
      'name' => 'Autop correct',
      'filters' => [
        'filter_autop' => [
          'status' => 1,
@@ -310,6 +312,7 @@ public function testRequiredSummary() {
  public function testNormalization() {
    FilterFormat::create([
      'format' => 'filter_html_enabled',
      'name' => 'Filter HTML enabled',
      'filters' => [
        'filter_html' => [
          'status' => 1,
@@ -321,6 +324,7 @@ public function testNormalization() {
    ])->save();
    FilterFormat::create([
      'format' => 'filter_htmlcorrector_enabled',
      'name' => 'Filter HTML corrector enabled',
      'filters' => [
        'filter_htmlcorrector' => [
          'status' => 1,
@@ -329,6 +333,7 @@ public function testNormalization() {
    ])->save();
    FilterFormat::create([
      'format' => 'neither_filter_enabled',
      'name' => 'Neither filter enabled',
      'filters' => [],
    ])->save();

Loading