class TestField in Media entity slideshow 8
Same name and namespace in other branches
- 8.2 tests/src/Unit/ConstraintsTest.php \Drupal\Tests\media_entity_slideshow\Unit\TestField
Mock class for fields to test the ItemsCount constraint.
Hierarchy
- class \Drupal\Tests\media_entity_slideshow\Unit\TestField
Expanded class hierarchy of TestField
File
- tests/
src/ Unit/ ConstraintsTest.php, line 94
Namespace
Drupal\Tests\media_entity_slideshow\UnitView source
class TestField {
/**
* The field property.
*
* @var string
*/
protected $property;
/**
* TestField constructor.
*
* @param string|null $value
* (optional) The property value used for this test.
*/
public function __construct($value = NULL) {
$this->property = $value;
}
/**
* Mocks isEmpty() on \Drupal\Core\Entity\Plugin\DataType\EntityAdapter.
*/
public function isEmpty() {
return !isset($this->property);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TestField:: |
protected | property | The field property. | |
TestField:: |
public | function | Mocks isEmpty() on \Drupal\Core\Entity\Plugin\DataType\EntityAdapter. | |
TestField:: |
public | function | TestField constructor. |