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
|
@ -21,7 +21,7 @@ class MigrateNodeBundleSettingsTest extends MigrateDrupal6TestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$this->installConfig(['node']);
|
||||
$this->executeMigration('d6_node_type');
|
||||
|
|
|
@ -0,0 +1,92 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\node\Tests\NodeRevisionsUiBypassAccessTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\node\Tests;
|
||||
|
||||
use Drupal\node\Entity\NodeType;
|
||||
|
||||
/**
|
||||
* Tests the revision tab display.
|
||||
*
|
||||
* This test is similar to NodeRevisionsUITest except that it uses a user with
|
||||
* the bypass node access permission to make sure that the revision access
|
||||
* check adds correct cacheability metadata.
|
||||
*
|
||||
* @group node
|
||||
*/
|
||||
class NodeRevisionsUiBypassAccessTest extends NodeTestBase {
|
||||
|
||||
/**
|
||||
* User with bypass node access permission.
|
||||
*
|
||||
* @var \Drupal\user\Entity\User
|
||||
*/
|
||||
protected $editor;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static $modules = ['block'];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
// Create a user.
|
||||
$this->editor = $this->drupalCreateUser([
|
||||
'administer nodes',
|
||||
'edit any page content',
|
||||
'view page revisions',
|
||||
'bypass node access',
|
||||
'access user profiles',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the Revision tab is displayed correctly.
|
||||
*/
|
||||
function testDisplayRevisionTab() {
|
||||
$this->drupalPlaceBlock('local_tasks_block');
|
||||
|
||||
$this->drupalLogin($this->editor);
|
||||
$node_storage = $this->container->get('entity.manager')->getStorage('node');
|
||||
|
||||
// Set page revision setting 'create new revision'. This will mean new
|
||||
// revisions are created by default when the node is edited.
|
||||
$type = NodeType::load('page');
|
||||
$type->setNewRevision(TRUE);
|
||||
$type->save();
|
||||
|
||||
// Create the node.
|
||||
$node = $this->drupalCreateNode();
|
||||
|
||||
// Verify the checkbox is checked on the node edit form.
|
||||
$this->drupalGet('node/' . $node->id() . '/edit');
|
||||
$this->assertFieldChecked('edit-revision', "'Create new revision' checkbox is checked");
|
||||
|
||||
// Uncheck the create new revision checkbox and save the node.
|
||||
$edit = array('revision' => FALSE);
|
||||
$this->drupalPostForm('node/' . $node->id() . '/edit', $edit, 'Save and keep published');
|
||||
|
||||
$this->assertUrl($node->toUrl());
|
||||
$this->assertNoLink(t('Revisions'));
|
||||
|
||||
// Verify the checkbox is checked on the node edit form.
|
||||
$this->drupalGet('node/' . $node->id() . '/edit');
|
||||
$this->assertFieldChecked('edit-revision', "'Create new revision' checkbox is checked");
|
||||
|
||||
// Submit the form without changing the checkbox.
|
||||
$edit = array();
|
||||
$this->drupalPostForm('node/' . $node->id() . '/edit', $edit, 'Save and keep published');
|
||||
|
||||
$this->assertUrl($node->toUrl());
|
||||
$this->assertLink(t('Revisions'));
|
||||
}
|
||||
|
||||
}
|
|
@ -10,6 +10,7 @@ namespace Drupal\node\Tests;
|
|||
use Drupal\field\Entity\FieldConfig;
|
||||
use Drupal\node\Entity\NodeType;
|
||||
use Drupal\Core\Url;
|
||||
use Drupal\node\NodeTypeInterface;
|
||||
|
||||
/**
|
||||
* Ensures that node type functions work correctly.
|
||||
|
@ -124,6 +125,17 @@ class NodeTypeTest extends NodeTestBase {
|
|||
$this->assertRaw('Foo', 'Title field was found.');
|
||||
$this->assertRaw('Body', 'Body field was found.');
|
||||
|
||||
// Change the name through the API
|
||||
/** @var NodeTypeInterface $node_type */
|
||||
$node_type = NodeType::load('page');
|
||||
$node_type->set('name', 'NewBar');
|
||||
$node_type->save();
|
||||
|
||||
/** @var \Drupal\Core\Entity\EntityTypeBundleInfoInterface $bundle_info */
|
||||
$bundle_info = \Drupal::service('entity_type.bundle.info');
|
||||
$node_bundles = $bundle_info->getBundleInfo('node');
|
||||
$this->assertEqual($node_bundles['page']['label'], 'NewBar', 'Node type bundle cache is updated');
|
||||
|
||||
// Remove the body field.
|
||||
$this->drupalPostForm('admin/structure/types/manage/page/fields/node.page.body/delete', array(), t('Delete'));
|
||||
// Resave the settings for this type.
|
||||
|
|
|
@ -39,7 +39,7 @@ class NodeViewLanguageTest extends NodeTestBase {
|
|||
$node = $this->drupalCreateNode(array('langcode' => 'es'));
|
||||
|
||||
$this->drupalGet($node->urlInfo());
|
||||
$this->assertText('Spanish','The language field is displayed properly.');
|
||||
$this->assertText('Spanish', 'The language field is displayed properly.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -175,18 +175,18 @@ class BulkFormTest extends NodeTestBase {
|
|||
// operations are always applied to individual translations.
|
||||
$edit = array(
|
||||
// Original and all translations.
|
||||
'node_bulk_form[0]' => TRUE, // Node 1, English, original.
|
||||
'node_bulk_form[1]' => TRUE, // Node 1, British English.
|
||||
'node_bulk_form[2]' => TRUE, // Node 1, Italian.
|
||||
'node_bulk_form[0]' => TRUE, // Node 1, English, original.
|
||||
'node_bulk_form[1]' => TRUE, // Node 1, British English.
|
||||
'node_bulk_form[2]' => TRUE, // Node 1, Italian.
|
||||
// Original and only one translation.
|
||||
'node_bulk_form[3]' => TRUE, // Node 2, English.
|
||||
'node_bulk_form[4]' => TRUE, // Node 2, British English, original.
|
||||
'node_bulk_form[3]' => TRUE, // Node 2, English.
|
||||
'node_bulk_form[4]' => TRUE, // Node 2, British English, original.
|
||||
'node_bulk_form[5]' => FALSE, // Node 2, Italian.
|
||||
// Only a single translation.
|
||||
'node_bulk_form[6]' => TRUE, // Node 3, English.
|
||||
'node_bulk_form[6]' => TRUE, // Node 3, English.
|
||||
'node_bulk_form[7]' => FALSE, // Node 3, Italian, original.
|
||||
// Only a single untranslated node.
|
||||
'node_bulk_form[8]' => TRUE, // Node 4, English, untranslated.
|
||||
'node_bulk_form[8]' => TRUE, // Node 4, English, untranslated.
|
||||
'node_bulk_form[9]' => FALSE, // Node 5, British English, untranslated.
|
||||
'action' => 'node_unpublish_action',
|
||||
);
|
||||
|
@ -216,18 +216,18 @@ class BulkFormTest extends NodeTestBase {
|
|||
// nodes and individual translations are properly deleted.
|
||||
$edit = array(
|
||||
// Original and all translations.
|
||||
'node_bulk_form[0]' => TRUE, // Node 1, English, original.
|
||||
'node_bulk_form[1]' => TRUE, // Node 1, British English.
|
||||
'node_bulk_form[2]' => TRUE, // Node 1, Italian.
|
||||
'node_bulk_form[0]' => TRUE, // Node 1, English, original.
|
||||
'node_bulk_form[1]' => TRUE, // Node 1, British English.
|
||||
'node_bulk_form[2]' => TRUE, // Node 1, Italian.
|
||||
// Original and only one translation.
|
||||
'node_bulk_form[3]' => TRUE, // Node 2, English.
|
||||
'node_bulk_form[4]' => TRUE, // Node 2, British English, original.
|
||||
'node_bulk_form[3]' => TRUE, // Node 2, English.
|
||||
'node_bulk_form[4]' => TRUE, // Node 2, British English, original.
|
||||
'node_bulk_form[5]' => FALSE, // Node 2, Italian.
|
||||
// Only a single translation.
|
||||
'node_bulk_form[6]' => TRUE, // Node 3, English.
|
||||
'node_bulk_form[6]' => TRUE, // Node 3, English.
|
||||
'node_bulk_form[7]' => FALSE, // Node 3, Italian, original.
|
||||
// Only a single untranslated node.
|
||||
'node_bulk_form[8]' => TRUE, // Node 4, English, untranslated.
|
||||
'node_bulk_form[8]' => TRUE, // Node 4, English, untranslated.
|
||||
'node_bulk_form[9]' => FALSE, // Node 5, British English, untranslated.
|
||||
'action' => 'node_delete_action',
|
||||
);
|
||||
|
|
|
@ -22,7 +22,7 @@ class RevisionRelationshipsTest extends ViewTestBase {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('node' ,'node_test_views');
|
||||
public static $modules = array('node' , 'node_test_views');
|
||||
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
|
Reference in a new issue