Update to drupal-org-drupal 8.0.0-rc2. For more information, see https://www.drupal.org/node/2598668

This commit is contained in:
Pantheon Automation 2015-10-21 21:44:50 -07:00 committed by Greg Anderson
parent f32e58e4b1
commit 8e18df8c36
3062 changed files with 15044 additions and 172506 deletions

View file

@ -295,7 +295,7 @@ class SystemMenuBlockTest extends KernelTestBase {
* Converts the result of MenuLinkTree::build() in a "menu link ID tree".
*
* @param array $build
* The return value of of MenuLinkTree::build()
* The return value of MenuLinkTree::build()
*
* @return array
* The "menu link ID tree" representation of the given render array.

View file

@ -87,6 +87,15 @@ class ApcuBackendUnitTest extends GenericCacheBackendUnitTestBase {
return;
}
parent::testSetGet();
// Make sure entries are permanent (i.e. no TTL).
$backend = $this->getCacheBackend($this->getTestBin());
$key = $backend->getApcuKey('TEST8');
foreach (new \APCIterator('user', '/^' . $key . '/') as $item) {
$this->assertEqual(0, $item['ttl']);
$found = TRUE;
}
$this->assertTrue($found);
}
/**

View file

@ -9,7 +9,6 @@ namespace Drupal\system\Tests\Common;
use Drupal\Component\Serialization\Json;
use Drupal\Component\Utility\Unicode;
use Drupal\Component\Utility\Crypt;
use Drupal\Core\Asset\AttachedAssets;
use Drupal\simpletest\KernelTestBase;

View file

@ -7,7 +7,6 @@
namespace Drupal\system\Tests\Common;
use Drupal\Core\Render\MainContent\HtmlRenderer;
use Drupal\simpletest\KernelTestBase;
/**

View file

@ -7,10 +7,7 @@
namespace Drupal\system\Tests\Common;
use Drupal\Component\Serialization\Json;
use Drupal\Component\Utility\Html;
use Drupal\Core\Render\Element;
use Drupal\Core\Url;
use Drupal\simpletest\KernelTestBase;
/**

View file

@ -7,9 +7,7 @@
namespace Drupal\system\Tests\Database;
use Doctrine\Common\Reflection\StaticReflectionProperty;
use Drupal\Core\Database\Database;
use Drupal\Core\Site\Settings;
use Drupal\simpletest\KernelTestBase;
/**

View file

@ -9,7 +9,6 @@ namespace Drupal\system\Tests\DrupalKernel;
use Drupal\simpletest\KernelTestBase;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\PostResponseEvent;
/**
* Tests that services are correctly destructed.

View file

@ -569,7 +569,7 @@ class ConfigEntityQueryTest extends KernelTestBase {
->condition('array.level1.level2', 3)
->execute();
$this->assertResults(array('5'));
// Make sure that values on the wildcard level do not match if if there are
// Make sure that values on the wildcard level do not match if there are
// sub-keys defined. This must not find anything even if entity 2 has a
// top-level key number with value 41.
$this->queryResults = $this->factory->get('config_query_test')

View file

@ -390,7 +390,7 @@ class ContentEntityChangedTest extends EntityUnitTestBase {
$this->assertFalse(
$this->getRevisionTranslationAffectedFlag($german),
'Changed flag of of the German translation is not set for new revision without changes.'
'Changed flag of the German translation is not set for new revision without changes.'
);
$entity->setNewRevision();

View file

@ -26,7 +26,7 @@ class EntityFormTest extends WebTestBase {
protected function setUp() {
parent::setUp();
$web_user = $this->drupalCreateUser(array('administer entity_test content'));
$web_user = $this->drupalCreateUser(array('administer entity_test content', 'view test entity'));
$this->drupalLogin($web_user);
// Add a language.
@ -84,14 +84,14 @@ class EntityFormTest extends WebTestBase {
$this->assertTrue($entity, format_string('%entity_type: Entity found in the database.', array('%entity_type' => $entity_type)));
$edit['name[0][value]'] = $name2;
$this->drupalPostForm($entity_type . '/manage/' . $entity->id(), $edit, t('Save'));
$this->drupalPostForm($entity_type . '/manage/' . $entity->id() . '/edit', $edit, t('Save'));
$entity = $this->loadEntityByName($entity_type, $name1);
$this->assertFalse($entity, format_string('%entity_type: The entity has been modified.', array('%entity_type' => $entity_type)));
$entity = $this->loadEntityByName($entity_type, $name2);
$this->assertTrue($entity, format_string('%entity_type: Modified entity found in the database.', array('%entity_type' => $entity_type)));
$this->assertNotEqual($entity->name->value, $name1, format_string('%entity_type: The entity name has been modified.', array('%entity_type' => $entity_type)));
$this->drupalGet($entity_type . '/manage/' . $entity->id());
$this->drupalGet($entity_type . '/manage/' . $entity->id() . '/edit');
$this->clickLink(t('Delete'));
$this->drupalPostForm(NULL, array(), t('Delete'));
$entity = $this->loadEntityByName($entity_type, $name2);
@ -125,12 +125,12 @@ class EntityFormTest extends WebTestBase {
$this->assertEqual($translated_entity->name->value, $name1_ro, format_string('%entity_type: The translation has been added.', array('%entity_type' => $entity_type_id)));
$edit['name[0][value]'] = $name2_ro;
$this->drupalPostForm('ro/' . $entity_type_id . '/manage/' . $entity->id(), $edit, t('Save'));
$this->drupalPostForm('ro/' . $entity_type_id . '/manage/' . $entity->id() . '/edit', $edit, t('Save'));
$translated_entity = $this->loadEntityByName($entity_type_id, $name1)->getTranslation('ro');
$this->assertTrue($translated_entity, format_string('%entity_type: Modified translation found in the database.', array('%entity_type' => $entity_type_id)));
$this->assertEqual($translated_entity->name->value, $name2_ro, format_string('%entity_type: The name of the translation has been modified.', array('%entity_type' => $entity_type_id)));
$this->drupalGet('ro/' . $entity_type_id . '/manage/' . $entity->id());
$this->drupalGet('ro/' . $entity_type_id . '/manage/' . $entity->id() . '/edit');
$this->clickLink(t('Delete'));
$this->drupalPostForm(NULL, array(), t('Delete Romanian translation'));
$entity = $this->loadEntityByName($entity_type_id, $name1);

View file

@ -37,6 +37,7 @@ class EntityRevisionsTest extends WebTestBase {
// Create and login user.
$this->webUser = $this->drupalCreateUser(array(
'administer entity_test content',
'view test entity',
));
$this->drupalLogin($this->webUser);
}
@ -110,7 +111,7 @@ class EntityRevisionsTest extends WebTestBase {
// Confirm the correct revision text appears in the edit form.
$entity = entity_load($entity_type, $entity->id->value);
$this->drupalGet($entity_type . '/manage/' . $entity->id->value);
$this->drupalGet($entity_type . '/manage/' . $entity->id->value . '/edit');
$this->assertFieldById('edit-name-0-value', $entity->name->value, format_string('%entity_type: Name matches in UI.', array('%entity_type' => $entity_type)));
$this->assertFieldById('edit-field-test-text-0-value', $entity->field_test_text->value, format_string('%entity_type: Text matches in UI.', array('%entity_type' => $entity_type)));
}

View file

@ -7,7 +7,6 @@
namespace Drupal\system\Tests\Entity;
use Drupal\system\Tests\Entity\EntityUnitTestBase;
use Drupal\system\Tests\TypedData;
use Drupal\Core\TypedData\DataDefinition;

View file

@ -9,7 +9,6 @@ namespace Drupal\system\Tests\Form;
use Drupal\Core\Form\FormState;
use Drupal\simpletest\WebTestBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Tests the tableselect form element for expected behavior.

View file

@ -7,7 +7,6 @@
namespace Drupal\system\Tests\Path;
use Drupal\Core\Url;
use Drupal\simpletest\WebTestBase;
/**

View file

@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\system\Tests\Theme\TableTest.
* Contains \Drupal\system\Tests\Render\Element\TableTest.
*/
namespace Drupal\system\Tests\Theme;
namespace Drupal\system\Tests\Render\Element;
use Drupal\simpletest\KernelTestBase;

View file

@ -7,9 +7,7 @@
namespace Drupal\system\Tests\Routing;
use Drupal\Core\Routing\RequestHelper;
use Drupal\simpletest\WebTestBase;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
/**
* Function Tests for the routing permission system.

View file

@ -11,7 +11,6 @@ use Drupal\Core\Cache\Cache;
use Drupal\Core\EventSubscriber\MainContentViewSubscriber;
use Drupal\Core\Language\LanguageInterface;
use Drupal\simpletest\WebTestBase;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Exception\RouteNotFoundException;
use Drupal\Core\Url;
@ -92,6 +91,18 @@ class RouterTest extends WebTestBase {
$headers = $this->drupalGetHeaders();
$this->assertEqual($headers['x-drupal-cache-contexts'], 'user.roles');
$this->assertEqual($headers['x-drupal-cache-tags'], '');
// Finally, verify that the X-Drupal-Cache-Contexts and X-Drupal-Cache-Tags
// headers are not sent when their container parameter is set to FALSE.
$this->drupalGet('router_test/test18');
$headers = $this->drupalGetHeaders();
$this->assertTrue(isset($headers['x-drupal-cache-contexts']));
$this->assertTrue(isset($headers['x-drupal-cache-tags']));
$this->setHttpResponseDebugCacheabilityHeaders(FALSE);
$this->drupalGet('router_test/test18');
$headers = $this->drupalGetHeaders();
$this->assertFalse(isset($headers['x-drupal-cache-contexts']));
$this->assertFalse(isset($headers['x-drupal-cache-tags']));
}
/**

View file

@ -184,6 +184,12 @@ class ThemeTest extends WebTestBase {
)
);
$this->assertEqual($elements[0]['src'], file_create_url($uploaded_filename));
$this->container->get('theme_handler')->install(array('bartik'));
$this->drupalGet('admin/appearance/settings/bartik');
// The logo field should only be present on the global theme settings form.
$this->assertNoFieldByName('logo_path');
$this->drupalPostForm(NULL, [], t('Save configuration'));
}
/**

View file

@ -70,7 +70,7 @@ class TokenReplaceUnitTest extends TokenReplaceUnitTestBase {
// Non-existing token.
$source .= '[bogus:token]';
// Replace with with the clear parameter, only the valid token should remain.
// Replace with the clear parameter, only the valid token should remain.
$target = Html::escape($this->config('system.site')->get('name'));
$result = $this->tokenService->replace($source, array(), array('langcode' => $this->interfaceLanguage->getId(), 'clear' => TRUE));
$this->assertEqual($target, $result, 'Valid tokens replaced while invalid tokens ignored.');

View file

@ -7,11 +7,7 @@
namespace Drupal\system\Tests\System;
use Drupal\Core\Site\Settings;
use Drupal\Core\Url;
use Drupal\simpletest\WebTestBase;
use Drupal\user\Entity\User;
use Symfony\Component\HttpFoundation\Request;
/**
* Tests output on the status overview page.

View file

@ -8,7 +8,6 @@
namespace Drupal\system\Tests\Theme;
use Drupal\simpletest\WebTestBase;
use Drupal\Core\Template\Attribute;
/**
* Tests Drupal's Twig filters.

View file

@ -7,10 +7,7 @@
namespace Drupal\system\Tests\Theme;
use Drupal\Component\Utility\SafeMarkup;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Url;
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\simpletest\WebTestBase;
/**

View file

@ -8,7 +8,6 @@
namespace Drupal\system\Tests\Update;
use Drupal\filter\Entity\FilterFormat;
use Drupal\system\Tests\Update\UpdatePathTestBase;
/**
* Tests that the allowed html configutations are updated with attributes.

View file

@ -7,8 +7,6 @@
namespace Drupal\system\Tests\Update;
use Drupal\node\Entity\Node;
/**
* Tests the upgrade path for converting seven secondary local tasks into a block.
*

View file

@ -7,8 +7,6 @@
namespace Drupal\system\Tests\Update;
use Drupal\node\Entity\Node;
/**
* Tests the upgrade path for local actions/tasks being converted into blocks.
*

View file

@ -7,6 +7,8 @@
namespace Drupal\system\Tests\Update;
use Drupal\Component\Render\FormattableMarkup;
/**
* Tests hook_post_update().
*
@ -32,7 +34,7 @@ class UpdatePostUpdateTest extends UpdatePathTestBase {
// Ensure that normal and post_update updates are merged together on the
// selection page.
$this->assertRaw('<ul><li>8001 - Normal update_N() function. </li><li>First update.</li><li>Second update.</li><li>Test1 update.</li><li>Test0 update.</li></ul>');
$this->assertRaw('<ul><li>8001 - Normal update_N() function. </li><li>First update.</li><li>Second update.</li><li>Test1 update.</li><li>Test0 update.</li><li>Testing batch processing in post updates update.</li></ul>');
}
/**
@ -49,24 +51,34 @@ class UpdatePostUpdateTest extends UpdatePathTestBase {
$this->assertRaw('Test1 update');
$this->assertRaw('<h3>Update test0</h3>');
$this->assertRaw('Test0 update');
$this->assertRaw('<h3>Update test_batch</h3>');
$this->assertRaw('Test post update batches');
// Test state value set by each post update.
$updates = [
'update_test_postupdate_post_update_first',
'update_test_postupdate_post_update_second',
'update_test_postupdate_post_update_test1',
'update_test_postupdate_post_update_test0',
'update_test_postupdate_post_update_test_batch-1',
'update_test_postupdate_post_update_test_batch-2',
'update_test_postupdate_post_update_test_batch-3',
];
$this->assertIdentical($updates, \Drupal::state()->get('post_update_test_execution', []));
$key_value = \Drupal::keyValue('post_update');
$updates = array_merge([
'block_post_update_disable_blocks_with_missing_contexts',
'field_post_update_save_custom_storage_property',
'field_post_update_entity_reference_handler_setting',
'system_post_update_recalculate_configuration_entity_dependencies',
'views_post_update_update_cacheability_metadata',
], $updates);
$this->assertEqual($updates, $key_value->get('existing_updates'));
// Test post_update key value stores contains a list of the update functions
// that have run.
$existing_updates = array_count_values(\Drupal::keyValue('post_update')->get('existing_updates'));
$expected_updates = [
'update_test_postupdate_post_update_first',
'update_test_postupdate_post_update_second',
'update_test_postupdate_post_update_test1',
'update_test_postupdate_post_update_test0',
'update_test_postupdate_post_update_test_batch',
];
foreach ($expected_updates as $expected_update) {
$this->assertEqual($existing_updates[$expected_update], 1, new FormattableMarkup("@expected_update exists in 'existing_updates' key and only appears once.", ['@expected_update' => $expected_update]));
}
$this->drupalGet('update.php/selection');
$this->assertText('No pending updates.');