You are here

public function NodeRevisionDeleteTest::providerGetConfiguredContentTypes in Node Revision Delete 8

Data provider for testGetConfiguredContentTypes().

Return value

array An array of arrays, each containing:

  • 'expected' - Expected return.
  • 'third_party_settings' - The content type third party settings.
  • 'content_types_list' - A list with content types objects.

See also

testGetConfiguredContentTypes()

File

tests/src/Unit/NodeRevisionDeleteTest.php, line 527

Class

NodeRevisionDeleteTest
Tests the NodeRevisionDelete class methods.

Namespace

Drupal\Tests\node_revision_delete\Unit

Code

public function providerGetConfiguredContentTypes() {
  $third_party_settings = [
    [
      [
        'node_revision_delete' => [
          0,
        ],
      ],
      [
        'www' => [
          1,
        ],
      ],
      [
        'node_revision_delete' => [
          2,
        ],
      ],
    ],
    [
      [
        'xxx' => [
          0,
        ],
      ],
      [
        'node_revision_delete' => [
          1,
        ],
      ],
      [
        'yyy' => [
          2,
        ],
      ],
      [
        'node_revision_delete' => [
          3,
        ],
      ],
    ],
    [
      [
        'xxx' => [
          1,
        ],
      ],
      [
        'yyy' => [
          3,
        ],
      ],
    ],
    [
      [
        'node_revision_delete' => [
          1,
        ],
      ],
      [
        'node_revision_delete' => [
          2,
        ],
      ],
      [
        'node_revision_delete' => [
          3,
        ],
      ],
    ],
    [
      [
        'node_revision_delete' => [
          1,
        ],
      ],
    ],
  ];
  $content_types_list = $this
    ->getConfiguredContentTypes();
  $expected = [
    [
      $content_types_list[0]['0'],
      $content_types_list[0]['2'],
    ],
    [
      $content_types_list[1]['1'],
      $content_types_list[1]['3'],
    ],
    [],
    [
      $content_types_list[3]['0'],
      $content_types_list[3]['1'],
      $content_types_list[3]['2'],
    ],
    [
      $content_types_list[4]['0'],
    ],
  ];
  $tests = [];
  $tests[] = [
    $expected[0],
    $third_party_settings[0],
    $content_types_list[0],
  ];
  $tests[] = [
    $expected[1],
    $third_party_settings[1],
    $content_types_list[1],
  ];
  $tests[] = [
    $expected[2],
    $third_party_settings[2],
    $content_types_list[2],
  ];
  $tests[] = [
    $expected[3],
    $third_party_settings[3],
    $content_types_list[3],
  ];
  $tests[] = [
    $expected[4],
    $third_party_settings[4],
    $content_types_list[4],
  ];
  return $tests;
}