class TestMediaEntityConstraints 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\TestMediaEntityConstraints
Mock class to test the ItemsCount constraint.
Hierarchy
- class \Drupal\Tests\media_entity_slideshow\Unit\TestMediaEntityConstraints
Expanded class hierarchy of TestMediaEntityConstraints
File
- tests/
src/ Unit/ ConstraintsTest.php, line 61
Namespace
Drupal\Tests\media_entity_slideshow\UnitView source
class TestMediaEntityConstraints {
/**
* The source field names.
*
* @var array
*/
protected $sourceFields = array();
/**
* TestMediaEntityConstraints constructor.
*
* @param string $name
* The source field name used for this test.
* @param string|null $value
* (optional) The source field value used for this test.
*/
public function __construct($name, $value = NULL) {
$this->sourceFields[$name] = new TestField($value);
}
/**
* Mocks get() on \Drupal\Core\Entity\FieldableEntityInterface.
*/
public function get($name) {
return $this->sourceFields[$name];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TestMediaEntityConstraints:: |
protected | property | The source field names. | |
TestMediaEntityConstraints:: |
public | function | Mocks get() on \Drupal\Core\Entity\FieldableEntityInterface. | |
TestMediaEntityConstraints:: |
public | function | TestMediaEntityConstraints constructor. |