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
|
@ -10,6 +10,7 @@ namespace Drupal\taxonomy\Tests;
|
|||
use Drupal\Component\Utility\SafeMarkup;
|
||||
use Drupal\Component\Utility\Xss;
|
||||
use Drupal\Core\Field\FieldStorageDefinitionInterface;
|
||||
use Drupal\Core\Render\BubbleableMetadata;
|
||||
|
||||
/**
|
||||
* Generates text using placeholders for dummy content to check taxonomy token
|
||||
|
@ -91,10 +92,26 @@ class TokenReplaceTest extends TaxonomyTestBase {
|
|||
$tests['[term:node-count]'] = 0;
|
||||
$tests['[term:parent:name]'] = '[term:parent:name]';
|
||||
$tests['[term:vocabulary:name]'] = SafeMarkup::checkPlain($this->vocabulary->label());
|
||||
$tests['[term:vocabulary]'] = SafeMarkup::checkPlain($this->vocabulary->label());
|
||||
|
||||
$base_bubbleable_metadata = BubbleableMetadata::createFromObject($term1);
|
||||
|
||||
$metadata_tests = array();
|
||||
$metadata_tests['[term:tid]'] = $base_bubbleable_metadata;
|
||||
$metadata_tests['[term:name]'] = $base_bubbleable_metadata;
|
||||
$metadata_tests['[term:description]'] = $base_bubbleable_metadata;
|
||||
$metadata_tests['[term:url]'] = $base_bubbleable_metadata;
|
||||
$metadata_tests['[term:node-count]'] = $base_bubbleable_metadata;
|
||||
$metadata_tests['[term:parent:name]'] = $base_bubbleable_metadata;
|
||||
$bubbleable_metadata = clone $base_bubbleable_metadata;
|
||||
$metadata_tests['[term:vocabulary:name]'] = $bubbleable_metadata->addCacheTags($this->vocabulary->getCacheTags());
|
||||
$metadata_tests['[term:vocabulary]'] = $bubbleable_metadata->addCacheTags($this->vocabulary->getCacheTags());
|
||||
|
||||
foreach ($tests as $input => $expected) {
|
||||
$output = $token_service->replace($input, array('term' => $term1), array('langcode' => $language_interface->getId()));
|
||||
$bubbleable_metadata = new BubbleableMetadata();
|
||||
$output = $token_service->replace($input, array('term' => $term1), array('langcode' => $language_interface->getId()), $bubbleable_metadata);
|
||||
$this->assertEqual($output, $expected, format_string('Sanitized taxonomy term token %token replaced.', array('%token' => $input)));
|
||||
$this->assertEqual($bubbleable_metadata, $metadata_tests[$input]);
|
||||
}
|
||||
|
||||
// Generate and test sanitized tokens for term2.
|
||||
|
|
Reference in a new issue