You are here

public function OnlyOneTest::providerGetAvailableContentTypes in Allow a content type only once (Only One) 8

Data provider for multiple tests.

Return value

array An array of arrays, each containing:

  • 'expected' - Expected return from getAvailableContentTypes().
  • 'multilingual' - Whether the site is multilingual or not.

See also

testGetAvailableContentTypes()

testGetAvailableContentTypesSummarized()

File

tests/src/Unit/OnlyOneTest.php, line 518

Class

OnlyOneTest
Tests the OnlyOne class methods.

Namespace

Drupal\Tests\onlyone\Unit

Code

public function providerGetAvailableContentTypes() {
  $tests['multilingual 1'] = [
    [
      'page',
      'article',
    ],
    TRUE,
  ];
  $tests['multilingual 2'] = [
    [
      'page',
    ],
    TRUE,
  ];
  $tests['multilingual 3'] = [
    [
      'page',
      'article',
      'blog',
    ],
    TRUE,
  ];
  $tests['not multilingual 1'] = [
    [
      'page',
      'article',
    ],
    FALSE,
  ];
  $tests['not multilingual 2'] = [
    [
      'page',
    ],
    FALSE,
  ];
  $tests['not multilingual 3'] = [
    [
      'page',
      'article',
      'blog',
    ],
    FALSE,
  ];
  return $tests;
}