public function OnlyOneTest::providerExistsNodesContentType in Allow a content type only once (Only One) 8
Data provider for testExistsNodesContentType().
Return value
array An array of arrays, each containing:
- 'expected' - Expected return from existsNodesContentType().
- 'content_type' - The content type to check.
- 'multilingual' - Whether the site is multilingual or not.
- 'current_language' - The current language selected from the interface.
- 'nids' - An array of ids. The keys and values are entity ids.
See also
testExistsNodesContentType()
File
- tests/
src/ Unit/ OnlyOneTest.php, line 277
Class
- OnlyOneTest
- Tests the OnlyOne class methods.
Namespace
Drupal\Tests\onlyone\UnitCode
public function providerExistsNodesContentType() {
$tests['node multilingual 1'] = [
1,
'page',
TRUE,
'en',
[
1 => 1,
],
];
$tests['node multilingual 2'] = [
1,
'page',
TRUE,
'es',
[
1 => 1,
],
];
$tests['node multilingual 3'] = [
2,
'article',
TRUE,
'en',
[
2 => 2,
],
];
$tests['node multilingual 4'] = [
2,
'article',
TRUE,
'es',
[
2 => 2,
],
];
$tests['node multilingual 5'] = [
3,
'blog',
TRUE,
'en',
[
3 => 3,
],
];
$tests['node multilingual 6'] = [
4,
'book',
TRUE,
'es',
[
4 => 4,
],
];
$tests['node not multilingual 1'] = [
1,
'page',
FALSE,
'en',
[
1 => 1,
],
];
$tests['node not multilingual 2'] = [
1,
'page',
FALSE,
'es',
[
1 => 1,
],
];
$tests['node not multilingual 3'] = [
2,
'article',
FALSE,
'en',
[
2 => 2,
],
];
$tests['node not multilingual 4'] = [
2,
'article',
FALSE,
'es',
[
2 => 2,
],
];
$tests['node not multilingual 5'] = [
3,
'blog',
FALSE,
'en',
[
3 => 3,
],
];
$tests['node not multilingual 6'] = [
4,
'book',
FALSE,
'es',
[
4 => 4,
],
];
$tests['not node multilingual 1'] = [
0,
'page',
TRUE,
'en',
[],
];
$tests['not node multilingual 2'] = [
0,
'page',
TRUE,
'es',
[],
];
$tests['not node multilingual 3'] = [
0,
'article',
TRUE,
'en',
[],
];
$tests['not node multilingual 4'] = [
0,
'article',
TRUE,
'es',
[],
];
$tests['not node multilingual 5'] = [
0,
'blog',
TRUE,
'en',
[],
];
$tests['not node multilingual 6'] = [
0,
'book',
TRUE,
'es',
[],
];
$tests['not node not multilingual 1'] = [
0,
'page',
FALSE,
'en',
[],
];
$tests['not node not multilingual 2'] = [
0,
'page',
FALSE,
'es',
[],
];
$tests['not node not multilingual 3'] = [
0,
'article',
FALSE,
'en',
[],
];
$tests['not node not multilingual 4'] = [
0,
'article',
FALSE,
'es',
[],
];
$tests['not node not multilingual 5'] = [
0,
'blog',
FALSE,
'en',
[],
];
$tests['not node not multilingual 6'] = [
0,
'book',
FALSE,
'es',
[],
];
return $tests;
}