public function OnlyOneUnitTestTrait::getContentTypesList in Allow a content type only once (Only One) 8
Returns a content type label list.
Return value
array An associative array with the content type machine name as key and it label as value.
1 call to OnlyOneUnitTestTrait::getContentTypesList()
- OnlyOneTest::getOnlyOneMock in tests/
src/ Unit/ OnlyOneTest.php - Mock some OnlyOne class functions.
File
- tests/
src/ Traits/ OnlyOneUnitTestTrait.php, line 226
Class
- OnlyOneUnitTestTrait
- Trait for common function to Unit tests.
Namespace
Drupal\Tests\onlyone\TraitsCode
public function getContentTypesList() {
// The content types list.
$content_types_list = [
'page' => 'Basic Page',
'blog' => 'Blog Post',
'car' => 'Car',
'article' => 'Article',
];
return $content_types_list;
}