private function NodeTypeThumbnailFormHelperTest::getFieldDefinition in Acquia Lift Connector 8
Get FieldDefinition mock.
Parameters
string $type: FieldDefinition type.
2 calls to NodeTypeThumbnailFormHelperTest::getFieldDefinition()
- NodeTypeThumbnailFormHelperTest::testGetFormWithFieldAndStyle in tests/
src/ Unit/ Service/ Helper/ NodeTypeThumbnailFormHelperTest.php - Tests the getForm() method, with an image field and with style.
- NodeTypeThumbnailFormHelperTest::testGetFormWithNoStyle in tests/
src/ Unit/ Service/ Helper/ NodeTypeThumbnailFormHelperTest.php - Tests the getForm() method, no style.
File
- tests/
src/ Unit/ Service/ Helper/ NodeTypeThumbnailFormHelperTest.php, line 180 - Contains \Drupal\Tests\acquia_lift\Service\Helper\NodeTypeThumbnailFormHelperTest.
Class
- NodeTypeThumbnailFormHelperTest
- NodeTypeThumbnailFormHelper Test.
Namespace
Drupal\Tests\acquia_lift\Service\HelperCode
private function getFieldDefinition($type = 'other') {
$field_definition = $this
->getMock('Drupal\\Core\\Field\\FieldDefinitionInterface');
$field_definition
->expects($this
->at(0))
->method('getType')
->willReturn($type);
$field_definition
->expects($this
->at(1))
->method('getSetting')
->with('target_type')
->willReturn($type . '_setting');
$field_definition
->expects($this
->at(2))
->method('getLabel')
->willReturn(ucfirst($type) . ' Label');
return $field_definition;
}