EmailFieldRdfaTest.php in Zircon Profile 8
File
core/modules/rdf/src/Tests/Field/EmailFieldRdfaTest.php
View source
<?php
namespace Drupal\rdf\Tests\Field;
class EmailFieldRdfaTest extends FieldRdfaTestBase {
protected $fieldType = 'email';
public static $modules = array(
'text',
);
protected function setUp() {
parent::setUp();
$this
->createTestField();
$mapping = rdf_get_mapping('entity_test', 'entity_test');
$mapping
->setFieldMapping($this->fieldName, array(
'properties' => array(
'schema:email',
),
))
->save();
$this->testValue = 'test@example.com';
$this->entity = entity_create('entity_test', array());
$this->entity->{$this->fieldName}->value = $this->testValue;
}
public function testAllFormatters() {
$this
->assertFormatterRdfa(array(
'type' => 'string',
), 'http://schema.org/email', array(
'value' => $this->testValue,
));
$this
->assertFormatterRdfa(array(
'type' => 'email_mailto',
), 'http://schema.org/email', array(
'value' => $this->testValue,
));
}
}