Update to Drupal 8.0.0 beta 14. For more information, see https://drupal.org/node/2544542
This commit is contained in:
parent
3b2511d96d
commit
81ccda77eb
2155 changed files with 54307 additions and 46870 deletions
|
@ -200,11 +200,8 @@ class EntityReferenceFormatterTest extends EntityUnitTestBase {
|
|||
';
|
||||
$renderer->renderRoot($build[0]);
|
||||
$this->assertEqual($build[0]['#markup'], 'default | ' . $this->referencedEntity->label() . $expected_rendered_name_field_1 . $expected_rendered_body_field_1, sprintf('The markup returned by the %s formatter is correct for an item with a saved entity.', $formatter));
|
||||
$expected_cache_tags = Cache::mergeTags(
|
||||
\Drupal::entityManager()->getViewBuilder($this->entityType)->getCacheTags(),
|
||||
$this->referencedEntity->getCacheTags(),
|
||||
FilterFormat::load('full_html')->getCacheTags()
|
||||
);
|
||||
$expected_cache_tags = Cache::mergeTags(\Drupal::entityManager()->getViewBuilder($this->entityType)->getCacheTags(), $this->referencedEntity->getCacheTags());
|
||||
$expected_cache_tags = Cache::mergeTags($expected_cache_tags, FilterFormat::load('full_html')->getCacheTags());
|
||||
$this->assertEqual($build[0]['#cache']['tags'], $expected_cache_tags, format_string('The @formatter formatter has the expected cache tags.', array('@formatter' => $formatter)));
|
||||
|
||||
// Test the second field item.
|
||||
|
|
|
@ -29,6 +29,11 @@ class FieldDataCountTest extends FieldUnitTestBase {
|
|||
*/
|
||||
protected $storageRev;
|
||||
|
||||
/**
|
||||
* @var \Drupal\Core\Entity\DynamicallyFieldableEntityStorageInterface
|
||||
*/
|
||||
protected $storageUser;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
@ -37,6 +42,7 @@ class FieldDataCountTest extends FieldUnitTestBase {
|
|||
$this->installEntitySchema('entity_test_rev');
|
||||
$this->storage = \Drupal::entityManager()->getStorage('entity_test');
|
||||
$this->storageRev = \Drupal::entityManager()->getStorage('entity_test_rev');
|
||||
$this->storageUser = \Drupal::entityManager()->getStorage('user');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -136,4 +142,22 @@ class FieldDataCountTest extends FieldUnitTestBase {
|
|||
$this->assertEqual(count($entity->{$this->fieldTestData->field_name_2}), $cardinality, format_string('Revision %revision_id: expected number of values.', array('%revision_id' => $first_revision)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify that we can count a table that contains an entry with index 0.
|
||||
*/
|
||||
public function testCountWithIndex0() {
|
||||
// Create an entry for the anonymous user, who has user ID 0.
|
||||
$user = $this->storageUser
|
||||
->create(array(
|
||||
'uid' => 0,
|
||||
'name' => 'anonymous',
|
||||
'mail' => NULL,
|
||||
'status' => FALSE,
|
||||
));
|
||||
$user->save();
|
||||
|
||||
$storage = $user->getFieldDefinition('name')->getFieldStorageDefinition();
|
||||
$this->assertIdentical(TRUE, $this->storageUser->countFieldData($storage, TRUE));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Reference in a new issue