You are here

class TestField in Media entity slideshow 8

Same name and namespace in other branches
  1. 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\Unit
View 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

Namesort descending Modifiers Type Description Overrides
TestField::$property protected property The field property.
TestField::isEmpty public function Mocks isEmpty() on \Drupal\Core\Entity\Plugin\DataType\EntityAdapter.
TestField::__construct public function TestField constructor.