You are here

private function NodeRevisionDeleteTest::getConfiguredContentTypes in Node Revision Delete 8

Returns a content type list.

Return value

array An array of node type objects.

2 calls to NodeRevisionDeleteTest::getConfiguredContentTypes()
NodeRevisionDeleteTest::providerGetConfiguredContentTypes in tests/src/Unit/NodeRevisionDeleteTest.php
Data provider for testGetConfiguredContentTypes().
NodeRevisionDeleteTest::providerUpdateTimeMaxNumberConfig in tests/src/Unit/NodeRevisionDeleteTest.php
Data provider for testUpdateTimeMaxNumberConfig().

File

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

Class

NodeRevisionDeleteTest
Tests the NodeRevisionDelete class methods.

Namespace

Drupal\Tests\node_revision_delete\Unit

Code

private function getConfiguredContentTypes() {
  $content_types = [
    [
      'article',
      'page',
      'test',
    ],
    [
      'article',
      'blog',
      'house',
      'page',
    ],
    [
      'blog',
      'house',
    ],
    [
      'article',
      'blog',
      'page',
    ],
    [
      'blog',
    ],
  ];

  // Getting the number of tests.
  $number_of_tests = count($content_types);
  $content_types_list = [];

  // Creating the array of objects.
  for ($i = 0; $i < $number_of_tests; $i++) {
    $j = 0;

    // Creating the array of objects.
    foreach ($content_types[$i] as $id) {

      // EntityInterface mock.
      $content_types_list[$i][$j] = $this
        ->createMock('Drupal\\Core\\Entity\\EntityInterface');

      // Mocking id method.
      $content_types_list[$i][$j]
        ->expects($this
        ->any())
        ->method('id')
        ->willReturn($id);
      $j++;
    }
  }
  return $content_types_list;
}