public function FieldApiTest::createContentType in Field Formatter Filter 8
Same name and namespace in other branches
- 2.0.x tests/src/Kernel/FieldApiTest.php \Drupal\Tests\field_formatter_filter\Kernel\FieldApiTest::createContentType()
Create our test content type.
Extend ContentTypeCreationTrait. I'm not sure, but it seems this is not expected to be a thing we use in Kernel tests - is it based around assuming a simpletest environment?
@inheritdoc
2 calls to FieldApiTest::createContentType()
- FieldApiTest::testCreateContentType in tests/
src/ Kernel/ FieldApiTest.php - Tests creating and configuring a bundle.
- FieldApiTest::testTeaserFilter in tests/
src/ Kernel/ FieldApiTest.php - Test enabling the filter formatter. Check before, during and after.
File
- tests/
src/ Kernel/ FieldApiTest.php, line 150
Class
- FieldApiTest
- Tests applying the filter formatter to a node.
Namespace
Drupal\Tests\field_formatter_filter\KernelCode
public function createContentType(array $values = []) {
// From ContentTypeCreationTrait.
$content_type = $this
->drupalCreateContentType($values);
// To avoid too many dependencies,
// -- just toggle off the 'display user' for view modes.
$content_type
->set('display_submitted', FALSE);
$content_type
->save();
}