updated core

This commit is contained in:
Bachir Soussi Chiadmi
2018-01-24 13:36:32 +01:00
parent cd7dea45a9
commit f9374cf96d
1997 changed files with 5175 additions and 127715 deletions
+3 -3
View File
@@ -7,8 +7,8 @@ package: Core
dependencies:
- field
# Information added by Drupal.org packaging script on 2017-11-03
version: '8.4.2'
# Information added by Drupal.org packaging script on 2018-01-03
version: '8.4.4'
core: '8.x'
project: 'drupal'
datestamp: 1509719929
datestamp: 1515021228
@@ -111,7 +111,8 @@ class EntityViewDisplayEditForm extends EntityDisplayFormBase {
/**
* {@inheritdoc}
*/
protected function getDisplayModesLink() {;
protected function getDisplayModesLink() {
;
return [
'#type' => 'link',
'#title' => t('Manage view modes'),
@@ -1,124 +0,0 @@
<?php
namespace Drupal\field_ui\Tests;
use Drupal\simpletest\WebTestBase;
/**
* Tests the entity display modes UI.
*
* @group field_ui
*/
class EntityDisplayModeTest extends WebTestBase {
/**
* Modules to enable.
*
* @var string[]
*/
public static $modules = ['block', 'entity_test', 'field_ui'];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->drupalPlaceBlock('local_actions_block');
$this->drupalPlaceBlock('page_title_block');
}
/**
* Tests the EntityViewMode user interface.
*/
public function testEntityViewModeUI() {
// Test the listing page.
$this->drupalGet('admin/structure/display-modes/view');
$this->assertResponse(403);
$this->drupalLogin($this->drupalCreateUser(array('administer display modes')));
$this->drupalGet('admin/structure/display-modes/view');
$this->assertResponse(200);
$this->assertText(t('Add new view mode'));
$this->assertLinkByHref('admin/structure/display-modes/view/add');
$this->assertLinkByHref('admin/structure/display-modes/view/add/entity_test');
$this->drupalGet('admin/structure/display-modes/view/add/entity_test_mulrev');
$this->assertResponse(404);
$this->drupalGet('admin/structure/display-modes/view/add');
$this->assertNoLink(t('Test entity - revisions and data table'), 'An entity type with no view builder cannot have view modes.');
// Test adding a view mode including dots in machine_name.
$this->clickLink(t('Test entity'));
$edit = array(
'id' => strtolower($this->randomMachineName()) . '.' . strtolower($this->randomMachineName()),
'label' => $this->randomString(),
);
$this->drupalPostForm(NULL, $edit, t('Save'));
$this->assertRaw('The machine-readable name must contain only lowercase letters, numbers, and underscores.');
// Test adding a view mode.
$edit = array(
'id' => strtolower($this->randomMachineName()),
'label' => $this->randomString(),
);
$this->drupalPostForm(NULL, $edit, t('Save'));
$this->assertRaw(t('Saved the %label view mode.', array('%label' => $edit['label'])));
// Test editing the view mode.
$this->drupalGet('admin/structure/display-modes/view/manage/entity_test.' . $edit['id']);
// Test deleting the view mode.
$this->clickLink(t('Delete'));
$this->assertRaw(t('Are you sure you want to delete the view mode %label?', array('%label' => $edit['label'])));
$this->drupalPostForm(NULL, NULL, t('Delete'));
$this->assertRaw(t('The view mode %label has been deleted.', array('%label' => $edit['label'])));
}
/**
* Tests the EntityFormMode user interface.
*/
public function testEntityFormModeUI() {
// Test the listing page.
$this->drupalGet('admin/structure/display-modes/form');
$this->assertResponse(403);
$this->drupalLogin($this->drupalCreateUser(array('administer display modes')));
$this->drupalGet('admin/structure/display-modes/form');
$this->assertResponse(200);
$this->assertText(t('Add new form mode'));
$this->assertLinkByHref('admin/structure/display-modes/form/add');
$this->drupalGet('admin/structure/display-modes/form/add/entity_test_no_label');
$this->assertResponse(404);
$this->drupalGet('admin/structure/display-modes/form/add');
$this->assertNoLink(t('Entity Test without label'), 'An entity type with no form cannot have form modes.');
// Test adding a view mode including dots in machine_name.
$this->clickLink(t('Test entity'));
$edit = array(
'id' => strtolower($this->randomMachineName()) . '.' . strtolower($this->randomMachineName()),
'label' => $this->randomString(),
);
$this->drupalPostForm(NULL, $edit, t('Save'));
$this->assertRaw('The machine-readable name must contain only lowercase letters, numbers, and underscores.');
// Test adding a form mode.
$edit = array(
'id' => strtolower($this->randomMachineName()),
'label' => $this->randomString(),
);
$this->drupalPostForm(NULL, $edit, t('Save'));
$this->assertRaw(t('Saved the %label form mode.', array('%label' => $edit['label'])));
// Test editing the form mode.
$this->drupalGet('admin/structure/display-modes/form/manage/entity_test.' . $edit['id']);
// Test deleting the form mode.
$this->clickLink(t('Delete'));
$this->assertRaw(t('Are you sure you want to delete the form mode %label?', array('%label' => $edit['label'])));
$this->drupalPostForm(NULL, NULL, t('Delete'));
$this->assertRaw(t('The form mode %label has been deleted.', array('%label' => $edit['label'])));
}
}
@@ -1,41 +0,0 @@
<?php
namespace Drupal\field_ui\Tests;
use Drupal\simpletest\WebTestBase;
/**
* Tests indentation on Field UI.
*
* @group field_ui
*/
class FieldUIIndentationTest extends WebTestBase {
/**
* Modules to install.
*
* @var array
*/
public static $modules = array('node', 'field_ui', 'field_ui_test');
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
// Create a test user.
$admin_user = $this->drupalCreateUser(array('access content', 'administer content types', 'administer node display'));
$this->drupalLogin($admin_user);
// Create Basic page node type.
$this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
}
function testIndentation() {
$this->drupalGet('admin/structure/types/manage/page/display');
$this->assertRaw('js-indentation indentation');
}
}
@@ -1,120 +0,0 @@
<?php
namespace Drupal\field_ui\Tests;
use Drupal\Core\Entity\Entity\EntityFormMode;
use Drupal\Core\Entity\Entity\EntityViewMode;
use Drupal\simpletest\WebTestBase;
/**
* Tests the functionality of the Field UI route subscriber.
*
* @group field_ui
*/
class FieldUIRouteTest extends WebTestBase {
/**
* Modules to install.
*
* @var string[]
*/
public static $modules = ['block', 'entity_test', 'field_ui'];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->drupalLogin($this->rootUser);
$this->drupalPlaceBlock('local_tasks_block');
}
/**
* Ensures that entity types with bundles do not break following entity types.
*/
public function testFieldUIRoutes() {
$this->drupalGet('entity_test_no_id/structure/entity_test/fields');
$this->assertText('No fields are present yet.');
$this->drupalGet('admin/config/people/accounts/fields');
$this->assertTitle('Manage fields | Drupal');
$this->assertLocalTasks();
// Test manage display tabs and titles.
$this->drupalGet('admin/config/people/accounts/display/compact');
$this->assertResponse(403);
$this->drupalGet('admin/config/people/accounts/display');
$this->assertTitle('Manage display | Drupal');
$this->assertLocalTasks();
$edit = array('display_modes_custom[compact]' => TRUE);
$this->drupalPostForm(NULL, $edit, t('Save'));
$this->drupalGet('admin/config/people/accounts/display/compact');
$this->assertTitle('Manage display | Drupal');
$this->assertLocalTasks();
// Test manage form display tabs and titles.
$this->drupalGet('admin/config/people/accounts/form-display/register');
$this->assertResponse(403);
$this->drupalGet('admin/config/people/accounts/form-display');
$this->assertTitle('Manage form display | Drupal');
$this->assertLocalTasks();
$edit = array('display_modes_custom[register]' => TRUE);
$this->drupalPostForm(NULL, $edit, t('Save'));
$this->assertResponse(200);
$this->drupalGet('admin/config/people/accounts/form-display/register');
$this->assertTitle('Manage form display | Drupal');
$this->assertLocalTasks();
$this->assert(count($this->xpath('//ul/li[1]/a[contains(text(), :text)]', array(':text' => 'Default'))) == 1, 'Default secondary tab is in first position.');
// Create new view mode and verify it's available on the Manage Display
// screen after enabling it.
EntityViewMode::create(array(
'id' => 'user.test',
'label' => 'Test',
'targetEntityType' => 'user',
))->save();
$this->container->get('router.builder')->rebuildIfNeeded();
$edit = array('display_modes_custom[test]' => TRUE);
$this->drupalPostForm('admin/config/people/accounts/display', $edit, t('Save'));
$this->assertLink('Test');
// Create new form mode and verify it's available on the Manage Form
// Display screen after enabling it.
EntityFormMode::create(array(
'id' => 'user.test',
'label' => 'Test',
'targetEntityType' => 'user',
))->save();
$this->container->get('router.builder')->rebuildIfNeeded();
$edit = array('display_modes_custom[test]' => TRUE);
$this->drupalPostForm('admin/config/people/accounts/form-display', $edit, t('Save'));
$this->assertLink('Test');
}
/**
* Asserts that local tasks exists.
*/
public function assertLocalTasks() {
$this->assertLink('Settings');
$this->assertLink('Manage fields');
$this->assertLink('Manage display');
$this->assertLink('Manage form display');
}
/**
* Asserts that admin routes are correctly marked as such.
*/
public function testAdminRoute() {
$route = \Drupal::service('router.route_provider')->getRouteByName('entity.entity_test.field_ui_fields');
$is_admin = \Drupal::service('router.admin_context')->isAdminRoute($route);
$this->assertTrue($is_admin, 'Admin route correctly marked for "Manage fields" page.');
}
}
@@ -452,7 +452,7 @@ class ManageDisplayTest extends WebTestBase {
/**
* Asserts that a string is found in the rendered node in a view mode.
*
* @param EntityInterface $node
* @param \Drupal\Core\Entity\EntityInterface $node
* The node.
* @param $view_mode
* The view mode in which the node should be displayed.
@@ -471,7 +471,7 @@ class ManageDisplayTest extends WebTestBase {
/**
* Asserts that a string is not found in the rendered node in a view mode.
*
* @param EntityInterface $node
* @param \Drupal\Core\Entity\EntityInterface $node
* The node.
* @param $view_mode
* The view mode in which the node should be displayed.
@@ -492,7 +492,7 @@ class ManageDisplayTest extends WebTestBase {
* This helper function is used by assertNodeViewText() and
* assertNodeViewNoText().
*
* @param EntityInterface $node
* @param \Drupal\Core\Entity\EntityInterface $node
* The node.
* @param $view_mode
* The view mode in which the node should be displayed.
@@ -5,8 +5,8 @@ description: 'Support module for Field UI tests.'
package: Testing
# version: VERSION
# Information added by Drupal.org packaging script on 2017-11-03
version: '8.4.2'
# Information added by Drupal.org packaging script on 2018-01-03
version: '8.4.4'
core: '8.x'
project: 'drupal'
datestamp: 1509719929
datestamp: 1515021228