Drupal 8  8.0.2
FieldRdfaTestBase Class Reference
Inheritance diagram for FieldRdfaTestBase:

Static Public Attributes

static $modules = array('rdf')
 
- Static Public Attributes inherited from FieldUnitTestBase
static $modules = ['user', 'system', 'field', 'text', 'entity_test', 'field_test']
 

Protected Member Functions

 setUp ()
 
 assertFormatterRdfa ($formatter, $property, $expected_rdf_value)
 
 createTestField ($field_settings=array())
 
 getAbsoluteUri ($entity)
 
 parseContent ($content)
 
 xpathContent ($content, $xpath, array $arguments=array())
 
- Protected Member Functions inherited from FieldUnitTestBase
 setUp ()
 
 createFieldWithStorage ($suffix= '', $entity_type= 'entity_test', $bundle=NULL)
 
 entitySaveReload (EntityInterface $entity)
 
 entityValidateAndSave (EntityInterface $entity)
 
 _generateTestFieldValues ($cardinality)
 
 assertFieldValues (EntityInterface $entity, $field_name, $expected_values, $langcode=LanguageInterface::LANGCODE_NOT_SPECIFIED, $column= 'value')
 

Protected Attributes

 $fieldType
 
 $fieldName = 'field_test'
 
 $uri = 'http://ex.com'
 
 $entity
 
 $debug = TRUE
 
 $testValue
 
- Protected Attributes inherited from FieldUnitTestBase
 $fieldTestData
 

Member Function Documentation

assertFormatterRdfa (   $formatter,
  $property,
  $expected_rdf_value 
)
protected

Helper function to test the formatter's RDFa.

Parameters
array$formatterAn associative array describing the formatter to test and its settings containing:
  • type: The machine name of the field formatter to test.
  • settings: The settings of the field formatter to test.
string$propertyThe property that should be found.
array$expected_rdf_valueAn associative array describing the expected value of the property containing:
  • value: The actual value of the string or URI.
  • type: The type of RDF value, e.g. 'literal' for a string, or 'uri'. Defaults to 'literal'.
  • datatype: (optional) The datatype of the value (e.g. xsd:dateTime).

References Drupal\service().

Referenced by NumberFieldRdfaTest\testDecimalFormatter(), NumberFieldRdfaTest\testDecimalFormatterWithSettings(), NumberFieldRdfaTest\testFloatFormatter(), NumberFieldRdfaTest\testFloatFormatterWithScale(), NumberFieldRdfaTest\testFloatFormatterWithScaleExercised(), NumberFieldRdfaTest\testFloatFormatterWithSettings(), NumberFieldRdfaTest\testIntegerFormatter(), and NumberFieldRdfaTest\testIntegerFormatterWithSettings().

Here is the call graph for this function:

Here is the caller graph for this function:

createTestField (   $field_settings = array())
protected

Creates the field for testing.

Parameters
array$field_settings(optional) An array of field settings.

Referenced by LinkFieldRdfaTest\setUp(), NumberFieldRdfaTest\testDecimalFormatter(), NumberFieldRdfaTest\testDecimalFormatterWithSettings(), NumberFieldRdfaTest\testFloatFormatter(), NumberFieldRdfaTest\testFloatFormatterWithScale(), NumberFieldRdfaTest\testFloatFormatterWithScaleExercised(), NumberFieldRdfaTest\testFloatFormatterWithSettings(), NumberFieldRdfaTest\testIntegerFormatter(), and NumberFieldRdfaTest\testIntegerFormatterWithSettings().

Here is the caller graph for this function:

getAbsoluteUri (   $entity)
protected

Gets the absolute URI of an entity.

Parameters
\Drupal\Core\Entity\ContentEntityBase$entityThe entity for which to generate the URI.
Returns
string The absolute URI.
parseContent (   $content)
protected

Parses a content and return the html element.

Parameters
string$contentThe html to parse.
Returns
array An array containing simplexml objects.

Referenced by FieldRdfaTestBase\xpathContent().

Here is the caller graph for this function:

setUp ( )
protected

{}

References Drupal\service().

Here is the call graph for this function:

xpathContent (   $content,
  $xpath,
array  $arguments = array() 
)
protected

Performs an xpath search on a certain content.

The search is relative to the root element of the $content variable.

Parameters
string$contentThe html to parse.
string$xpathThe xpath string to use in the search.
array$argumentsSome arguments for the xpath.
Returns
array|FALSE The return value of the xpath search. For details on the xpath string format and return values see the SimpleXML documentation, http://php.net/manual/function.simplexml-element-xpath.php.

References FieldRdfaTestBase\parseContent().

Referenced by NumberFieldRdfaTest\testDecimalFormatter(), NumberFieldRdfaTest\testDecimalFormatterWithSettings(), NumberFieldRdfaTest\testFloatFormatter(), NumberFieldRdfaTest\testFloatFormatterWithScale(), NumberFieldRdfaTest\testFloatFormatterWithScaleExercised(), NumberFieldRdfaTest\testFloatFormatterWithSettings(), NumberFieldRdfaTest\testIntegerFormatter(), and NumberFieldRdfaTest\testIntegerFormatterWithSettings().

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following file: