You are here

interface SchemaMetatagTestTagInterface in Schema.org Metatag 8.2

Same name and namespace in other branches
  1. 8 src/SchemaMetatagTestTagInterface.php \Drupal\schema_metatag\SchemaMetatagTestTagInterface

Interface SchemaMetatagTestTagInterface.

Methods that provide test values for SchemaNameBase and its derivatives.

@package Drupal\schema_metatag

Hierarchy

Expanded class hierarchy of SchemaMetatagTestTagInterface

All classes that implement SchemaMetatagTestTagInterface

1 file declares its use of SchemaMetatagTestTagInterface
PropertyTypeBase.php in src/Plugin/schema_metatag/PropertyTypeBase.php

File

src/SchemaMetatagTestTagInterface.php, line 12

Namespace

Drupal\schema_metatag
View source
interface SchemaMetatagTestTagInterface {

  /**
   * Provide a test input value for the property that will validate.
   *
   * Tags like @type that contain values other than simple strings, for
   * instance a list of allowed options, should extend this method and return
   * a valid value.
   *
   * @param mixed $type
   *   The default to use for the @type element, if any.
   *
   * @return mixed
   *   Return the test value, either a string or array, depending on the
   *   property.
   */
  public function testValue($type = '');

  /**
   * Provide a test output value for the input value.
   *
   * Tags that return values in a different format than the input, like
   * values that are exploded, should extend this method and return
   * a valid value.
   *
   * @param mixed $items
   *   The input value, either a string or an array.
   *
   * @return mixed
   *   Return the correct output value.
   */
  public function processedTestValue($items);

  /**
   * Explode a test value.
   *
   * For test values, emulates the extra processing a multiple value would get.
   *
   * @param mixed $items
   *   The input value, either a string or an array.
   *
   * @return mixed
   *   Return the correct output value.
   */
  public function processTestExplodeValue($items);

  /**
   * Provide a random test value.
   *
   * A helper function to create a random test value. Use the delimiter to
   * create comma-separated values, or a few "words" separated by spaces.
   *
   * @param int $count
   *   Number of "words".
   * @param int $delimiter
   *   Delimiter used to connect "words".
   *
   * @return mixed
   *   Return the test value, either a string or array, depending on the
   *   property.
   */
  public function testDefaultValue($count = NULL, $delimiter = NULL);

}

Members

Namesort descending Modifiers Type Description Overrides
SchemaMetatagTestTagInterface::processedTestValue public function Provide a test output value for the input value. 1
SchemaMetatagTestTagInterface::processTestExplodeValue public function Explode a test value. 1
SchemaMetatagTestTagInterface::testDefaultValue public function Provide a random test value. 1
SchemaMetatagTestTagInterface::testValue public function Provide a test input value for the property that will validate. 1