You are here

public function NodeRevisionDeleteTest::providerUpdateTimeMaxNumberConfig in Node Revision Delete 8

Data provider for testUpdateTimeMaxNumberConfig().

Return value

array An array of arrays, each containing:

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

See also

testUpdateTimeMaxNumberConfig()

File

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

Class

NodeRevisionDeleteTest
Tests the NodeRevisionDelete class methods.

Namespace

Drupal\Tests\node_revision_delete\Unit

Code

public function providerUpdateTimeMaxNumberConfig() {
  $third_party_settings = [
    // 3 elements.
    [
      [
        'node_revision_delete' => [
          'minimum_age_to_delete' => 5,
          'when_to_delete' => 3,
        ],
      ],
      [
        'node_revision_delete' => [
          'minimum_age_to_delete' => 10,
          'when_to_delete' => 12,
        ],
      ],
      [
        'node_revision_delete' => [
          'minimum_age_to_delete' => 5,
          'when_to_delete' => 5,
        ],
      ],
    ],
    // 4 elements.
    [
      [
        'node_revision_delete' => [
          'minimum_age_to_delete' => 5,
          'when_to_delete' => 3,
        ],
      ],
      [
        'node_revision_delete' => [
          'minimum_age_to_delete' => 10,
          'when_to_delete' => 12,
        ],
      ],
      [
        'node_revision_delete' => [
          'minimum_age_to_delete' => 8,
          'when_to_delete' => 2,
        ],
      ],
      [
        'node_revision_delete' => [
          'minimum_age_to_delete' => 3,
          'when_to_delete' => 2,
        ],
      ],
    ],
    // 2 elements.
    [
      [
        'node_revision_delete' => [
          'minimum_age_to_delete' => 10,
          'when_to_delete' => 12,
        ],
      ],
      [
        'node_revision_delete' => [
          'minimum_age_to_delete' => 8,
          'when_to_delete' => 2,
        ],
      ],
    ],
    // 3 elements.
    [
      [
        'node_revision_delete' => [
          'minimum_age_to_delete' => 15,
          'when_to_delete' => 13,
        ],
      ],
      [
        'node_revision_delete' => [
          'minimum_age_to_delete' => 1,
          'when_to_delete' => 1,
        ],
      ],
      [
        'node_revision_delete' => [
          'minimum_age_to_delete' => 15,
          'when_to_delete' => 15,
        ],
      ],
    ],
    // 1 element.
    [
      [
        'node_revision_delete' => [
          'minimum_age_to_delete' => 5,
          'when_to_delete' => 3,
        ],
      ],
    ],
  ];
  $content_types_list = $this
    ->getConfiguredContentTypes();
  $tests = [];
  $tests[] = [
    $third_party_settings[0],
    $content_types_list[0],
    2,
  ];
  $tests[] = [
    $third_party_settings[1],
    $content_types_list[1],
    4,
  ];
  $tests[] = [
    $third_party_settings[2],
    $content_types_list[2],
    8,
  ];
  $tests[] = [
    $third_party_settings[3],
    $content_types_list[3],
    14,
  ];
  $tests[] = [
    $third_party_settings[4],
    $content_types_list[4],
    2,
  ];
  return $tests;
}