Update to Drupal 8.0.2. For more information, see https://www.drupal.org/drupal-8.0.2-release-notes
This commit is contained in:
parent
1a0e9d9fac
commit
a6b049dd05
538 changed files with 5247 additions and 1594 deletions
|
@ -26,7 +26,7 @@ class TermCacheTagsTest extends EntityWithUriCacheTagsTestBase {
|
|||
*/
|
||||
protected function createEntity() {
|
||||
// Create a "Camelids" vocabulary.
|
||||
$vocabulary = entity_create('taxonomy_vocabulary', array(
|
||||
$vocabulary = entity_create('taxonomy_vocabulary', array(
|
||||
'name' => 'Camelids',
|
||||
'vid' => 'camelids',
|
||||
));
|
||||
|
|
|
@ -551,4 +551,38 @@ class TermTest extends TaxonomyTestBase {
|
|||
$this->assertRaw($term->getName(), 'Term is displayed after saving the node with no changes.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the breadcrumb on edit and delete a term page.
|
||||
*/
|
||||
public function testTermBreadcrumbs() {
|
||||
$edit = [
|
||||
'name[0][value]' => $this->randomMachineName(14),
|
||||
'description[0][value]' => $this->randomMachineName(100),
|
||||
'parent[]' => [0],
|
||||
];
|
||||
|
||||
// Create the term.
|
||||
$this->drupalPostForm('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/add', $edit, t('Save'));
|
||||
|
||||
$terms = taxonomy_term_load_multiple_by_name($edit['name[0][value]']);
|
||||
$term = reset($terms);
|
||||
$this->assertNotNull($term, 'Term found in database.');
|
||||
|
||||
// Check the breadcrumb on the term edit page.
|
||||
$this->drupalGet('taxonomy/term/' . $term->id() . '/edit');
|
||||
$breadcrumbs = $this->cssSelect('nav.breadcrumb ol li a');
|
||||
$this->assertIdentical(count($breadcrumbs), 2, 'The breadcrumbs are present on the page.');
|
||||
$this->assertIdentical((string) $breadcrumbs[0], 'Home', 'First breadcrumb text is Home');
|
||||
$this->assertIdentical((string) $breadcrumbs[1], $term->label(), 'Second breadcrumb text is term name on term edit page.');
|
||||
$this->assertEscaped((string) $breadcrumbs[1], 'breadcrumbs displayed and escaped.');
|
||||
|
||||
// Check the breadcrumb on the term delete page.
|
||||
$this->drupalGet('taxonomy/term/' . $term->id() . '/delete');
|
||||
$breadcrumbs = $this->cssSelect('nav.breadcrumb ol li a');
|
||||
$this->assertIdentical(count($breadcrumbs), 2, 'The breadcrumbs are present on the page.');
|
||||
$this->assertIdentical((string) $breadcrumbs[0], 'Home', 'First breadcrumb text is Home');
|
||||
$this->assertIdentical((string) $breadcrumbs[1], $term->label(), 'Second breadcrumb text is term name on term delete page.');
|
||||
$this->assertEscaped((string) $breadcrumbs[1], 'breadcrumbs displayed and escaped.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\taxonomy\Tests\TermTranslationBreadcrumbTest.
|
||||
* Contains \Drupal\taxonomy\Tests\TermTranslationTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\taxonomy\Tests;
|
||||
|
@ -15,7 +15,7 @@ use Drupal\system\Tests\Menu\AssertBreadcrumbTrait;
|
|||
*
|
||||
* @group taxonomy
|
||||
*/
|
||||
class TermTranslationBreadcrumbTest extends TaxonomyTestBase {
|
||||
class TermTranslationTest extends TaxonomyTestBase {
|
||||
|
||||
use AssertBreadcrumbTrait;
|
||||
use TaxonomyTranslationTestTrait;
|
||||
|
@ -86,6 +86,34 @@ class TermTranslationBreadcrumbTest extends TaxonomyTestBase {
|
|||
$term = $this->getLeafTerm();
|
||||
$translated = $term->getTranslation($this->translateToLangcode);
|
||||
$this->assertBreadcrumb($translated->urlInfo('canonical', ['language' => $languages[$this->translateToLangcode]]), $breadcrumb, $translated->label());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test translation of terms are showed in the node.
|
||||
*/
|
||||
protected function testTermsTranslation() {
|
||||
|
||||
// Set the display of the term reference field on the article content type
|
||||
// to "Check boxes/radio buttons".
|
||||
entity_get_form_display('node', 'article', 'default')
|
||||
->setComponent($this->termFieldName, array(
|
||||
'type' => 'options_buttons',
|
||||
))
|
||||
->save();
|
||||
$this->drupalLogin($this->drupalCreateUser(['create article content']));
|
||||
|
||||
// Test terms are listed.
|
||||
$this->drupalget('node/add/article');
|
||||
$this->assertText('one');
|
||||
$this->assertText('two');
|
||||
$this->assertText('three');
|
||||
|
||||
// Test terms translated are listed.
|
||||
$this->drupalget('hu/node/add/article');
|
||||
$this->assertText('translatedOne');
|
||||
$this->assertText('translatedTwo');
|
||||
$this->assertText('translatedThree');
|
||||
}
|
||||
|
||||
/**
|
|
@ -61,7 +61,7 @@ class TaxonomyFieldFilterTest extends ViewTestBase {
|
|||
);
|
||||
|
||||
// Create a vocabulary.
|
||||
$this->vocabulary = entity_create('taxonomy_vocabulary', array(
|
||||
$this->vocabulary = entity_create('taxonomy_vocabulary', array(
|
||||
'name' => 'Views testing tags',
|
||||
'vid' => 'views_testing_tags',
|
||||
));
|
||||
|
|
|
@ -37,7 +37,7 @@ class TaxonomyTermArgumentDepthTest extends TaxonomyTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
// Create a term with markup in the label.
|
||||
|
|
|
@ -39,7 +39,7 @@ class TaxonomyTermFilterDepthTest extends TaxonomyTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
// Create a hierarchy 3 deep. Note the parent setup function creates two
|
||||
|
@ -118,9 +118,9 @@ class TaxonomyTermFilterDepthTest extends TaxonomyTestBase {
|
|||
/**
|
||||
* Changes the tid filter to given term and depth.
|
||||
*
|
||||
* @param integer $tid
|
||||
* @param int $tid
|
||||
* The term ID to filter on.
|
||||
* @param integer $depth
|
||||
* @param int $depth
|
||||
* The depth to search.
|
||||
* @param array $expected
|
||||
* The expected views result.
|
||||
|
|
|
@ -82,7 +82,7 @@ abstract class TaxonomyTestBase extends ViewTestBase {
|
|||
'type' => 'article',
|
||||
));
|
||||
// Create the vocabulary for the tag field.
|
||||
$this->vocabulary = entity_create('taxonomy_vocabulary', array(
|
||||
$this->vocabulary = entity_create('taxonomy_vocabulary', array(
|
||||
'name' => 'Views testing tags',
|
||||
'vid' => 'views_testing_tags',
|
||||
));
|
||||
|
|
Reference in a new issue