Update to Drupal 8.0.0-beta15. For more information, see: https://www.drupal.org/node/2563023
This commit is contained in:
parent
2720a9ec4b
commit
f3791f1da3
1898 changed files with 54300 additions and 11481 deletions
|
@ -34,7 +34,7 @@ class CommonDataConverter {
|
|||
* Returns the ISO 8601 timestamp.
|
||||
*/
|
||||
public static function dateIso8601Value($data) {
|
||||
return date_iso8601($data['value']);
|
||||
return \Drupal::service('date.formatter')->format($data['value'], 'custom', 'c', 'UTC');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -141,15 +141,13 @@ class RdfMapping extends ConfigEntityBase implements RdfMappingInterface {
|
|||
*/
|
||||
public function calculateDependencies() {
|
||||
parent::calculateDependencies();
|
||||
|
||||
// Create dependency on the bundle.
|
||||
$entity_type = \Drupal::entityManager()->getDefinition($this->targetEntityType);
|
||||
$this->addDependency('module', $entity_type->getProvider());
|
||||
$bundle_entity_type_id = $entity_type->getBundleEntityType();
|
||||
if ($bundle_entity_type_id != 'bundle') {
|
||||
// If the target entity type uses entities to manage its bundles then
|
||||
// depend on the bundle entity.
|
||||
$bundle_entity = \Drupal::entityManager()->getStorage($bundle_entity_type_id)->load($this->bundle);
|
||||
$this->addDependency('config', $bundle_entity->getConfigDependencyName());
|
||||
}
|
||||
$bundle_config_dependency = $entity_type->getBundleConfigDependency($this->bundle);
|
||||
$this->addDependency($bundle_config_dependency['type'], $bundle_config_dependency['name']);
|
||||
|
||||
return $this->dependencies;
|
||||
}
|
||||
|
||||
|
|
|
@ -144,6 +144,24 @@ class CommentAttributesTest extends CommentTestBase {
|
|||
$this->assertTrue($graph->hasProperty($this->nodeUri, 'http://rdfs.org/sioc/ns#num_replies', $expected_value), 'Number of comments found in RDF output of full node view mode (sioc:num_replies).');
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests comment author link markup has not been broken by RDF.
|
||||
*/
|
||||
public function testCommentRdfAuthorMarkup() {
|
||||
// Post a comment as a registered user.
|
||||
$this->saveComment($this->node->id(), $this->webUser->id());
|
||||
|
||||
// Give the user access to view user profiles so the profile link shows up.
|
||||
user_role_grant_permissions(RoleInterface::AUTHENTICATED_ID, ['access user profiles']);
|
||||
$this->drupalLogin($this->webUser);
|
||||
|
||||
// Ensure that the author link still works properly after the author output
|
||||
// is modified by the RDF module.
|
||||
$this->drupalGet('node/' . $this->node->id());
|
||||
$this->assertLink($this->webUser->getUsername());
|
||||
$this->assertLinkByHref('user/' . $this->webUser->id());
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests if RDFa markup for meta information is present in comments.
|
||||
*
|
||||
|
@ -264,14 +282,14 @@ class CommentAttributesTest extends CommentTestBase {
|
|||
// Comment date.
|
||||
$expected_value = array(
|
||||
'type' => 'literal',
|
||||
'value' => date('c', $comment->getCreatedTime()),
|
||||
'value' => format_date($comment->getCreatedTime(), 'custom', 'c', 'UTC'),
|
||||
'datatype' => 'http://www.w3.org/2001/XMLSchema#dateTime',
|
||||
);
|
||||
$this->assertTrue($graph->hasProperty($comment_uri, 'http://purl.org/dc/terms/date', $expected_value), 'Comment date found in RDF output (dc:date).');
|
||||
// Comment date.
|
||||
$expected_value = array(
|
||||
'type' => 'literal',
|
||||
'value' => date('c', $comment->getCreatedTime()),
|
||||
'value' => format_date($comment->getCreatedTime(), 'custom', 'c', 'UTC'),
|
||||
'datatype' => 'http://www.w3.org/2001/XMLSchema#dateTime',
|
||||
);
|
||||
$this->assertTrue($graph->hasProperty($comment_uri, 'http://purl.org/dc/terms/created', $expected_value), 'Comment date found in RDF output (dc:created).');
|
||||
|
|
|
@ -24,7 +24,7 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase {
|
|||
$this->assertFormatterRdfa(array('type' => 'number_integer'), 'http://schema.org/baseSalary', array('value' => $testValue));
|
||||
|
||||
// Test that the content attribute is not created.
|
||||
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field-item") and @content]');
|
||||
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__items") and @content]');
|
||||
$this->assertFalse($result);
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,8 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase {
|
|||
* Tests the integer formatter with settings.
|
||||
*/
|
||||
public function testIntegerFormatterWithSettings() {
|
||||
\Drupal::service('theme_handler')->install(['classy']);
|
||||
$this->config('system.theme')->set('default', 'classy')->save();
|
||||
$this->fieldType = 'integer';
|
||||
$formatter = array(
|
||||
'type' => 'number_integer',
|
||||
|
@ -50,7 +52,7 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase {
|
|||
$this->assertFormatterRdfa($formatter, 'http://schema.org/baseSalary', array('value' => $testValue));
|
||||
|
||||
// Test that the content attribute is created.
|
||||
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field-item") and @content=:testValue]', array(':testValue' => $testValue));
|
||||
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__item") and @content=:testValue]', array(':testValue' => $testValue));
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
|
@ -65,7 +67,7 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase {
|
|||
$this->assertFormatterRdfa(array('type' => 'number_unformatted'), 'http://schema.org/baseSalary', array('value' => $testValue));
|
||||
|
||||
// Test that the content attribute is not created.
|
||||
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field-item") and @content]');
|
||||
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__items") and @content]');
|
||||
$this->assertFalse($result);
|
||||
}
|
||||
|
||||
|
@ -73,6 +75,8 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase {
|
|||
* Tests the float formatter with settings.
|
||||
*/
|
||||
public function testFloatFormatterWithSettings() {
|
||||
\Drupal::service('theme_handler')->install(['classy']);
|
||||
$this->config('system.theme')->set('default', 'classy')->save();
|
||||
$this->fieldType = 'float';
|
||||
$formatter = array(
|
||||
'type' => 'number_decimal',
|
||||
|
@ -92,7 +96,7 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase {
|
|||
$this->assertFormatterRdfa($formatter, 'http://schema.org/baseSalary', array('value' => $testValue));
|
||||
|
||||
// Test that the content attribute is created.
|
||||
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field-item") and @content=:testValue]', array(':testValue' => $testValue));
|
||||
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__item") and @content=:testValue]', array(':testValue' => $testValue));
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
|
@ -113,7 +117,7 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase {
|
|||
$this->assertFormatterRdfa($formatter, 'http://schema.org/baseSalary', array('value' => $testValue));
|
||||
|
||||
// Test that the content attribute is not created.
|
||||
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field-item") and @content]');
|
||||
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__items") and @content]');
|
||||
$this->assertFalse($result);
|
||||
}
|
||||
|
||||
|
@ -121,6 +125,8 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase {
|
|||
* Tests the float formatter with a scale. Scale is exercised.
|
||||
*/
|
||||
public function testFloatFormatterWithScaleExercised() {
|
||||
\Drupal::service('theme_handler')->install(['classy']);
|
||||
$this->config('system.theme')->set('default', 'classy')->save();
|
||||
$this->fieldType = 'float';
|
||||
$formatter = array(
|
||||
'type' => 'number_decimal',
|
||||
|
@ -134,7 +140,7 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase {
|
|||
$this->assertFormatterRdfa($formatter, 'http://schema.org/baseSalary', array('value' => $testValue));
|
||||
|
||||
// Test that the content attribute is created.
|
||||
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field-item") and @content=:testValue]', array(':testValue' => $testValue));
|
||||
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__item") and @content=:testValue]', array(':testValue' => $testValue));
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
|
@ -149,7 +155,7 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase {
|
|||
$this->assertFormatterRdfa(array('type' => 'number_decimal'), 'http://schema.org/baseSalary', array('value' => $testValue));
|
||||
|
||||
// Test that the content attribute is not created.
|
||||
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field-item") and @content]');
|
||||
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__items") and @content]');
|
||||
$this->assertFalse($result);
|
||||
}
|
||||
|
||||
|
@ -157,6 +163,8 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase {
|
|||
* Tests the decimal formatter with settings.
|
||||
*/
|
||||
public function testDecimalFormatterWithSettings() {
|
||||
\Drupal::service('theme_handler')->install(['classy']);
|
||||
$this->config('system.theme')->set('default', 'classy')->save();
|
||||
$this->fieldType = 'decimal';
|
||||
$formatter = array(
|
||||
'type' => 'number_decimal',
|
||||
|
@ -176,7 +184,7 @@ class NumberFieldRdfaTest extends FieldRdfaTestBase {
|
|||
$this->assertFormatterRdfa($formatter, 'http://schema.org/baseSalary', array('value' => $testValue));
|
||||
|
||||
// Test that the content attribute is created.
|
||||
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field-item") and @content=:testValue]', array(':testValue' => $testValue));
|
||||
$result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field__item") and @content=:testValue]', array(':testValue' => $testValue));
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
|
|
|
@ -107,6 +107,10 @@ class StandardProfileTest extends WebTestBase {
|
|||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
// Use Classy theme for testing markup output.
|
||||
\Drupal::service('theme_handler')->install(['classy']);
|
||||
$this->config('system.theme')->set('default', 'classy')->save();
|
||||
|
||||
$this->baseUri = \Drupal::url('<front>', [], ['absolute' => TRUE]);
|
||||
|
||||
// Create two test users.
|
||||
|
@ -356,7 +360,7 @@ class StandardProfileTest extends WebTestBase {
|
|||
// Created date.
|
||||
$expected_value = array(
|
||||
'type' => 'literal',
|
||||
'value' => date_iso8601($node->get('created')->value),
|
||||
'value' => format_date($node->get('created')->value, 'custom', 'c', 'UTC'),
|
||||
'lang' => 'en',
|
||||
);
|
||||
$this->assertTrue($graph->hasProperty($uri, 'http://schema.org/dateCreated', $expected_value), "$message_prefix created date was found (schema:dateCreated) in teaser.");
|
||||
|
@ -445,7 +449,7 @@ class StandardProfileTest extends WebTestBase {
|
|||
// Comment created date.
|
||||
$expected_value = array(
|
||||
'type' => 'literal',
|
||||
'value' => date_iso8601($this->articleComment->get('created')->value),
|
||||
'value' => format_date($this->articleComment->get('created')->value, 'custom', 'c', 'UTC'),
|
||||
'lang' => 'en',
|
||||
);
|
||||
$this->assertTrue($graph->hasProperty($this->articleCommentUri, 'http://schema.org/dateCreated', $expected_value), 'Article comment created date was found (schema:dateCreated).');
|
||||
|
|
Reference in a new issue