Update to drupal 8.0.0-rc1. For more information, see https://www.drupal.org/node/2582663
This commit is contained in:
parent
eb34d130a8
commit
f32e58e4b1
8476 changed files with 211648 additions and 170042 deletions
|
@ -7,8 +7,6 @@
|
|||
|
||||
namespace Drupal\taxonomy\Tests;
|
||||
|
||||
use Drupal\Component\Utility\Html;
|
||||
use Drupal\Component\Utility\Xss;
|
||||
use Drupal\Core\Field\FieldStorageDefinitionInterface;
|
||||
use Drupal\Core\Render\BubbleableMetadata;
|
||||
|
||||
|
@ -86,13 +84,13 @@ class TokenReplaceTest extends TaxonomyTestBase {
|
|||
// Generate and test sanitized tokens for term1.
|
||||
$tests = array();
|
||||
$tests['[term:tid]'] = $term1->id();
|
||||
$tests['[term:name]'] = Html::escape($term1->getName());
|
||||
$tests['[term:name]'] = $term1->getName();
|
||||
$tests['[term:description]'] = $term1->description->processed;
|
||||
$tests['[term:url]'] = $term1->url('canonical', array('absolute' => TRUE));
|
||||
$tests['[term:node-count]'] = 0;
|
||||
$tests['[term:parent:name]'] = '[term:parent:name]';
|
||||
$tests['[term:vocabulary:name]'] = Html::escape($this->vocabulary->label());
|
||||
$tests['[term:vocabulary]'] = Html::escape($this->vocabulary->label());
|
||||
$tests['[term:vocabulary:name]'] = $this->vocabulary->label();
|
||||
$tests['[term:vocabulary]'] = $this->vocabulary->label();
|
||||
|
||||
$base_bubbleable_metadata = BubbleableMetadata::createFromObject($term1);
|
||||
|
||||
|
@ -117,14 +115,14 @@ class TokenReplaceTest extends TaxonomyTestBase {
|
|||
// Generate and test sanitized tokens for term2.
|
||||
$tests = array();
|
||||
$tests['[term:tid]'] = $term2->id();
|
||||
$tests['[term:name]'] = Html::escape($term2->getName());
|
||||
$tests['[term:name]'] = $term2->getName();
|
||||
$tests['[term:description]'] = $term2->description->processed;
|
||||
$tests['[term:url]'] = $term2->url('canonical', array('absolute' => TRUE));
|
||||
$tests['[term:node-count]'] = 1;
|
||||
$tests['[term:parent:name]'] = Html::escape($term1->getName());
|
||||
$tests['[term:parent:name]'] = $term1->getName();
|
||||
$tests['[term:parent:url]'] = $term1->url('canonical', array('absolute' => TRUE));
|
||||
$tests['[term:parent:parent:name]'] = '[term:parent:parent:name]';
|
||||
$tests['[term:vocabulary:name]'] = Html::escape($this->vocabulary->label());
|
||||
$tests['[term:vocabulary:name]'] = $this->vocabulary->label();
|
||||
|
||||
// Test to make sure that we generated something for each token.
|
||||
$this->assertFalse(in_array(0, array_map('strlen', $tests)), 'No empty tokens generated.');
|
||||
|
@ -134,22 +132,11 @@ class TokenReplaceTest extends TaxonomyTestBase {
|
|||
$this->assertEqual($output, $expected, format_string('Sanitized taxonomy term token %token replaced.', array('%token' => $input)));
|
||||
}
|
||||
|
||||
// Generate and test unsanitized tokens.
|
||||
$tests['[term:name]'] = $term2->getName();
|
||||
$tests['[term:description]'] = $term2->getDescription();
|
||||
$tests['[term:parent:name]'] = $term1->getName();
|
||||
$tests['[term:vocabulary:name]'] = $this->vocabulary->label();
|
||||
|
||||
foreach ($tests as $input => $expected) {
|
||||
$output = $token_service->replace($input, array('term' => $term2), array('langcode' => $language_interface->getId(), 'sanitize' => FALSE));
|
||||
$this->assertEqual($output, $expected, format_string('Unsanitized taxonomy term token %token replaced.', array('%token' => $input)));
|
||||
}
|
||||
|
||||
// Generate and test sanitized tokens.
|
||||
$tests = array();
|
||||
$tests['[vocabulary:vid]'] = $this->vocabulary->id();
|
||||
$tests['[vocabulary:name]'] = Html::escape($this->vocabulary->label());
|
||||
$tests['[vocabulary:description]'] = Xss::filter($this->vocabulary->getDescription());
|
||||
$tests['[vocabulary:name]'] = $this->vocabulary->label();
|
||||
$tests['[vocabulary:description]'] = $this->vocabulary->getDescription();
|
||||
$tests['[vocabulary:node-count]'] = 1;
|
||||
$tests['[vocabulary:term-count]'] = 2;
|
||||
|
||||
|
@ -160,15 +147,6 @@ class TokenReplaceTest extends TaxonomyTestBase {
|
|||
$output = $token_service->replace($input, array('vocabulary' => $this->vocabulary), array('langcode' => $language_interface->getId()));
|
||||
$this->assertEqual($output, $expected, format_string('Sanitized taxonomy vocabulary token %token replaced.', array('%token' => $input)));
|
||||
}
|
||||
|
||||
// Generate and test unsanitized tokens.
|
||||
$tests['[vocabulary:name]'] = $this->vocabulary->label();
|
||||
$tests['[vocabulary:description]'] = $this->vocabulary->getDescription();
|
||||
|
||||
foreach ($tests as $input => $expected) {
|
||||
$output = $token_service->replace($input, array('vocabulary' => $this->vocabulary), array('langcode' => $language_interface->getId(), 'sanitize' => FALSE));
|
||||
$this->assertEqual($output, $expected, format_string('Unsanitized taxonomy vocabulary token %token replaced.', array('%token' => $input)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue