Update to Drupal 8.1.2. For more information, see https://www.drupal.org/project/drupal/releases/8.1.2
This commit is contained in:
parent
9eae24d844
commit
28556d630e
1322 changed files with 6699 additions and 2064 deletions
|
@ -30,4 +30,5 @@ class CronAccessCheck implements AccessInterface {
|
|||
}
|
||||
return AccessResult::allowed()->setCacheMaxAge(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -34,4 +34,5 @@ class DbUpdateAccessCheck implements AccessInterface {
|
|||
return AccessResult::forbidden()->cachePerPermissions();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -422,7 +422,7 @@ class DbUpdateController extends ControllerBase {
|
|||
}
|
||||
|
||||
if (Settings::get('update_free_access')) {
|
||||
$message .= '<p>' . $this->t("<strong>Reminder: don't forget to set the <code>\$settings['update_free_access']</code> value in your <code>settings.php</code> file back to <code>FALSE</code>.</strong>") . '</p>';
|
||||
$message .= '<p>' . $this->t("<strong>Reminder: don't forget to set the <code>\$settings['update_free_access']</code> value in your <code>settings.php</code> file back to <code>FALSE</code>.</strong>") . '</p>';
|
||||
}
|
||||
|
||||
$build['message'] = array(
|
||||
|
|
|
@ -259,7 +259,7 @@ class ModulesListForm extends FormBase {
|
|||
if (!empty($module->info['required'])) {
|
||||
// Used when displaying modules that are required by the installation profile
|
||||
$row['enable']['#disabled'] = TRUE;
|
||||
$row['#required_by'][] = $distribution . (!empty($module->info['explanation']) ? ' ('. $module->info['explanation'] .')' : '');
|
||||
$row['#required_by'][] = $distribution . (!empty($module->info['explanation']) ? ' (' . $module->info['explanation'] . ')' : '');
|
||||
}
|
||||
|
||||
// Check the compatibilities.
|
||||
|
|
|
@ -187,4 +187,5 @@ class ModulesUninstallForm extends FormBase {
|
|||
// Redirect to the confirm form.
|
||||
$form_state->setRedirect('system.modules_uninstall_confirm');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -379,6 +379,16 @@ class ThemeSettingsForm extends ConfigFormBase {
|
|||
}
|
||||
}
|
||||
|
||||
// When intending to use the default logo, unset the logo_path.
|
||||
if ($form_state->getValue('default_logo')) {
|
||||
$form_state->unsetValue('logo_path');
|
||||
}
|
||||
|
||||
// When intending to use the default favicon, unset the favicon_path.
|
||||
if ($form_state->getValue('default_favicon')) {
|
||||
$form_state->unsetValue('favicon_path');
|
||||
}
|
||||
|
||||
// If the user provided a path for a logo or favicon file, make sure a file
|
||||
// exists at that path.
|
||||
if ($form_state->getValue('logo_path')) {
|
||||
|
|
|
@ -58,10 +58,10 @@ class MachineNameController implements ContainerInjectionInterface {
|
|||
$lowercase = $request->query->get('lowercase');
|
||||
|
||||
$transliterated = $this->transliteration->transliterate($text, $langcode, '_');
|
||||
if($lowercase) {
|
||||
if ($lowercase) {
|
||||
$transliterated = Unicode::strtolower($transliterated);
|
||||
}
|
||||
if(isset($replace_pattern) && isset($replace)) {
|
||||
if (isset($replace_pattern) && isset($replace)) {
|
||||
// Quote the pattern delimiter and remove null characters to avoid the e
|
||||
// or other modifiers being injected.
|
||||
$transliterated = preg_replace('@' . strtr($replace_pattern, ['@' => '\@', chr(0) => '']) . '@', $replace, $transliterated);
|
||||
|
|
|
@ -431,4 +431,5 @@ class GDToolkit extends ImageToolkitBase {
|
|||
protected static function supportedTypes() {
|
||||
return array(IMAGETYPE_PNG, IMAGETYPE_JPEG, IMAGETYPE_GIF);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -88,4 +88,5 @@ class SystemConfigSubscriber implements EventSubscriberInterface {
|
|||
$events[ConfigEvents::IMPORT_VALIDATE][] = array('onConfigImporterValidateSiteUUID', 256);
|
||||
return $events;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -28,4 +28,5 @@ class AjaxInGroupTest extends AjaxTestBase {
|
|||
$this->assertText('AJAX checkbox in a nested group');
|
||||
$this->assertText('Another AJAX checkbox in a nested group');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -59,4 +59,5 @@ abstract class AjaxTestBase extends WebTestBase {
|
|||
}
|
||||
$this->assertTrue($found, $message);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -34,4 +34,5 @@ class ElementValidationTest extends AjaxTestBase {
|
|||
$this->assertNoText(t('Error message'), 'No error message in resultant JSON');
|
||||
$this->assertText('ajax_forms_test_validation_number_form_callback invoked', 'The correct callback was invoked');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -60,4 +60,5 @@ class FormValuesTest extends AjaxTestBase {
|
|||
// Not using File API; a potential error must trigger a PHP warning.
|
||||
unlink(\Drupal::root() . '/' . $this->siteDirectory . '/error.log');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -211,4 +211,5 @@ class FrameworkTest extends AjaxTestBase {
|
|||
// cache control.
|
||||
$this->assertNoText('js.module.css?', 'Ajax lazy loading does not add overridden CSS files.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -94,4 +94,5 @@ class MultiFormTest extends AjaxTestBase {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -181,7 +181,7 @@ class ProcessingTest extends WebTestBase {
|
|||
* TRUE on pass, FALSE on fail.
|
||||
*/
|
||||
function assertBatchMessages($texts, $message) {
|
||||
$pattern = '|' . implode('.*', $texts) .'|s';
|
||||
$pattern = '|' . implode('.*', $texts) . '|s';
|
||||
return $this->assertPattern($pattern, $message);
|
||||
}
|
||||
|
||||
|
@ -292,4 +292,5 @@ class ProcessingTest extends WebTestBase {
|
|||
}
|
||||
return $messages;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -57,4 +57,5 @@ class GetFilenameUnitTest extends KernelTestBase {
|
|||
// Restore the original error handler.
|
||||
restore_error_handler();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -37,4 +37,5 @@ class ResettableStaticUnitTest extends KernelTestBase {
|
|||
drupal_static_reset();
|
||||
$this->assertEqual($var, 'foo', 'Variable was reset after second invocation of global reset.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -82,4 +82,5 @@ abstract class CacheTestBase extends WebTestBase {
|
|||
$cached = \Drupal::cache($bin)->get($cid);
|
||||
$this->assertFalse($cached, $message);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -38,4 +38,5 @@ class ClearTest extends CacheTestBase {
|
|||
$this->assertFalse($this->checkCacheExists($cid, $this->defaultValue, $bin), format_string('All cache entries removed from @bin.', array('@bin' => $bin)));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,4 +22,5 @@ class MemoryBackendUnitTest extends GenericCacheBackendUnitTestBase {
|
|||
\Drupal::service('cache_tags.invalidator')->addInvalidator($backend);
|
||||
return $backend;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -91,4 +91,5 @@ class AddFeedTest extends WebTestBase {
|
|||
$text = \Drupal::service('renderer')->renderRoot($variables);
|
||||
$this->assertEqual(trim(strip_tags($text)), 'Subscribe to <>&"'', 'feed_icon template escapes reserved HTML characters.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -68,4 +68,5 @@ class AlterTest extends WebTestBase {
|
|||
\Drupal::theme()->alter(array('drupal_alter', 'drupal_alter_foo'), $array_copy);
|
||||
$this->assertEqual($array_copy, $array_expected, 'hook_TYPE_alter() implementations ran in correct order.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -118,4 +118,5 @@ class FormatDateTest extends WebTestBase {
|
|||
$this->assertIdentical($formatter->format($timestamp, 'custom', '\<\s\c\r\i\p\t\>\a\l\e\r\t\(\'Y\'\)\;\<\/\s\c\r\i\p\t\>'), "<script>alert('2007');</script>", 'Script tags not removed from dates.');
|
||||
$this->assertIdentical($formatter->format($timestamp, 'custom', '\<\e\m\>Y\<\/\e\m\>'), '<em>2007</em>', 'Em tags are not removed from dates.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -187,7 +187,7 @@ class RenderElementTypesTest extends KernelTestBase {
|
|||
),
|
||||
);
|
||||
|
||||
foreach($elements as $element) {
|
||||
foreach ($elements as $element) {
|
||||
$xml = new \SimpleXMLElement(\Drupal::service('renderer')->renderRoot($element['value']));
|
||||
$result = $xml->xpath($element['expected']);
|
||||
$this->assertTrue($result, '"' . $element['name'] . '" input rendered correctly by drupal_render().');
|
||||
|
|
|
@ -90,4 +90,5 @@ class SimpleTestErrorCollectorTest extends WebTestBase {
|
|||
$this->assertEqual($error['message'], $message, format_string("Message was %message", array('%message' => $message)));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -65,4 +65,5 @@ class SizeUnitTest extends KernelTestBase {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -50,4 +50,5 @@ class SystemListingTest extends KernelTestBase {
|
|||
)));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -137,4 +137,5 @@ class TableSortExtenderUnitTest extends KernelTestBase {
|
|||
$this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => Html::escape(var_export($ts, TRUE)))));
|
||||
$this->assertEqual($ts, $expected_ts, 'Complex table headers plus $_GET parameters sorted correctly.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -316,4 +316,5 @@ class UrlTest extends WebTestBase {
|
|||
$result = Url::fromUri($url, array('query' => $query))->toString();
|
||||
$this->assertEqual($url . '&' . http_build_query($query, '', '&'), $result);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -53,4 +53,5 @@ class XssUnitTest extends KernelTestBase {
|
|||
$this->assertIdentical(UrlHelper::stripDangerousProtocols($url), $expected_plain, '\Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() filters a URL and returns plain text.');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,4 +22,5 @@ abstract class DatabaseWebTestBase extends WebTestBase {
|
|||
|
||||
DatabaseTestBase::addSampleData();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -164,4 +164,5 @@ class SelectPagerDefaultTest extends DatabaseWebTestBase {
|
|||
$this->assertEqual($name, 'John', 'Pager query #3 with a generated element ID returned the correct results.');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -53,4 +53,5 @@ class TemporaryQueryTest extends DatabaseWebTestBase {
|
|||
$table_name_test = db_query_temporary($sql, array());
|
||||
$this->assertEqual($this->countTableRows($table_name_test), $this->countTableRows('test'), 'Leading white space and comments do not interfere with temporary table creation.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -54,4 +54,5 @@ class ServiceDestructionTest extends KernelTestBase {
|
|||
$kernel->terminate($request, $response);
|
||||
$this->assertNull(\Drupal::state()->get('service_provider_test.destructed'));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -199,7 +199,7 @@ trait EntityDefinitionTestTrait {
|
|||
/**
|
||||
* Adds an index to the 'entity_test_update' entity type's base table.
|
||||
*
|
||||
* @see \Drupal\entity_test\EntityTestStorageSchema::getEntitySchema().
|
||||
* @see \Drupal\entity_test\EntityTestStorageSchema::getEntitySchema()
|
||||
*/
|
||||
protected function addEntityIndex() {
|
||||
$indexes = array(
|
||||
|
|
|
@ -112,4 +112,5 @@ class EntityRevisionsTest extends WebTestBase {
|
|||
$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)));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -110,4 +110,5 @@ class EntityTranslationFormTest extends WebTestBase {
|
|||
$form_langcode = \Drupal::state()->get('entity_test.form_langcode');
|
||||
$this->assertTrue($langcode2 == $form_langcode, "Node edit form language is $langcode2.");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -192,8 +192,7 @@ abstract class EntityUnitTestBase extends KernelTestBase {
|
|||
// Drupal supported databases and is known to work for other databases
|
||||
// like SQL Server 2014 and Oracle 10 too.
|
||||
$id = $string ? $this->randomMachineName() : mt_rand(1, 0x7FFFFFFF);
|
||||
}
|
||||
while (isset($this->generatedIds[$id]));
|
||||
} while (isset($this->generatedIds[$id]));
|
||||
$this->generatedIds[$id] = $id;
|
||||
return $id;
|
||||
}
|
||||
|
|
|
@ -159,4 +159,5 @@ class DirectoryTest extends FileTestBase {
|
|||
$this->assertEqual(empty($tmp_directory), FALSE, 'file_directory_temp() returned a non-empty value.');
|
||||
$this->assertEqual($config->get('path.temporary'), $tmp_directory);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -164,4 +164,5 @@ abstract class FileTestBase extends KernelTestBase {
|
|||
$this->assertTrue(is_file($filepath), t('The test file exists on the disk.'), 'Create test file');
|
||||
return $filepath;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -86,4 +86,5 @@ class MimeTypeTest extends FileTestBase {
|
|||
$this->assertIdentical($output, $expected, format_string('Mimetype (using passed-in mappings) for %input is %output (expected: %expected).', array('%input' => $input, '%output' => $output, '%expected' => $expected)));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -83,4 +83,5 @@ class NameMungingTest extends FileTestBase {
|
|||
$unmunged_name = file_unmunge_filename($munged_name);
|
||||
$this->assertIdentical($unmunged_name, $this->name, format_string('The unmunged (%unmunged) filename matches the original (%original)', array('%unmunged' => $unmunged_name, '%original' => $this->name)));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -85,4 +85,5 @@ class ReadOnlyStreamWrapperTest extends FileTestBase {
|
|||
// Remove the temporary directory.
|
||||
drupal_rmdir($dir);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -34,4 +34,5 @@ class RemoteFileDirectoryTest extends DirectoryTest {
|
|||
parent::setUp();
|
||||
$this->config('system.file')->set('default_scheme', 'dummy-remote')->save();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -34,4 +34,5 @@ class RemoteFileScanDirectoryTest extends ScanDirectoryTest {
|
|||
parent::setUp();
|
||||
$this->config('system.file')->set('default_scheme', 'dummy-remote')->save();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -34,4 +34,5 @@ class RemoteFileUnmanagedCopyTest extends UnmanagedCopyTest {
|
|||
parent::setUp();
|
||||
$this->config('system.file')->set('default_scheme', 'dummy-remote')->save();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -34,4 +34,5 @@ class RemoteFileUnmanagedDeleteRecursiveTest extends UnmanagedDeleteRecursiveTes
|
|||
parent::setUp();
|
||||
$this->config('system.file')->set('default_scheme', 'dummy-remote')->save();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -34,4 +34,5 @@ class RemoteFileUnmanagedDeleteTest extends UnmanagedDeleteTest {
|
|||
parent::setUp();
|
||||
$this->config('system.file')->set('default_scheme', 'dummy-remote')->save();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -34,4 +34,5 @@ class RemoteFileUnmanagedMoveTest extends UnmanagedMoveTest {
|
|||
parent::setUp();
|
||||
$this->config('system.file')->set('default_scheme', 'dummy-remote')->save();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -34,4 +34,5 @@ class RemoteFileUnmanagedSaveDataTest extends UnmanagedSaveDataTest {
|
|||
parent::setUp();
|
||||
$this->config('system.file')->set('default_scheme', 'dummy-remote')->save();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -141,4 +141,5 @@ class ScanDirectoryTest extends FileTestBase {
|
|||
$files = file_scan_directory($this->path, '/^javascript-/', array('min_depth' => 1));
|
||||
$this->assertTrue(empty($files), 'Minimum-depth of 1 successfully excludes files from current directory.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ class StreamWrapperTest extends FileTestBase {
|
|||
* Test some file handle functions.
|
||||
*/
|
||||
function testFileFunctions() {
|
||||
$filename = 'public://'. $this->randomMachineName();
|
||||
$filename = 'public://' . $this->randomMachineName();
|
||||
file_put_contents($filename, str_repeat('d', 1000));
|
||||
|
||||
// Open for rw and place pointer at beginning of file so select will return.
|
||||
|
@ -145,4 +145,5 @@ class StreamWrapperTest extends FileTestBase {
|
|||
$this->assertTrue(file_stream_wrapper_valid_scheme(file_uri_scheme('public://asdf')), 'Got a valid stream scheme from public://asdf');
|
||||
$this->assertFalse(file_stream_wrapper_valid_scheme(file_uri_scheme('foo://asdf')), 'Did not get a valid stream scheme from foo://asdf');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -85,4 +85,5 @@ class UnmanagedCopyTest extends FileTestBase {
|
|||
$this->assertTrue(file_exists($new_filepath), 'Copied file exists after copying onto itself.');
|
||||
$this->assertFilePermissions($new_filepath, Settings::get('file_chmod_file', FileSystem::CHMOD_FILE));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -70,4 +70,5 @@ class UnmanagedDeleteRecursiveTest extends FileTestBase {
|
|||
$this->assertFalse(file_exists($subdirectory), 'Subdirectory has been deleted.');
|
||||
$this->assertFalse(file_exists($directory), 'Directory has been deleted.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -39,4 +39,5 @@ class UnmanagedDeleteTest extends FileTestBase {
|
|||
$this->assertFalse(file_unmanaged_delete($directory), 'Could not delete the delete directory.');
|
||||
$this->assertTrue(file_exists($directory), 'Directory has not been deleted.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -69,4 +69,5 @@ class UnmanagedMoveTest extends FileTestBase {
|
|||
$this->assertFalse(file_exists($uri), 'Original file has been removed.');
|
||||
$this->assertTrue(file_exists($new_filepath), 'File exists after moving onto itself.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -28,4 +28,5 @@ class UnmanagedSaveDataTest extends FileTestBase {
|
|||
$this->assertEqual($contents, file_get_contents($filepath), 'Contents of the file are correct.');
|
||||
$this->assertFilePermissions($filepath, 0777);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -89,4 +89,5 @@ class FileTransferTest extends WebTestBase {
|
|||
}
|
||||
$this->assertTrue($gotit, 'Was able to copy a directory inside of the jailed area');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,4 +19,5 @@ class MockTestConnection {
|
|||
$this->commandsRun = array();
|
||||
return $out;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -61,4 +61,5 @@ class TestFileTransfer extends FileTransfer {
|
|||
function chmodJailed($path, $mode, $recursive) {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -35,4 +35,5 @@ class AlterTest extends WebTestBase {
|
|||
$content = preg_replace('/\s+/', ' ', Xss::filter($this->content, array()));
|
||||
$this->assert(strpos($content, implode(' ', $expected)) !== FALSE, 'Form alter hooks executed in the expected order.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -72,4 +72,5 @@ class ArbitraryRebuildTest extends WebTestBase {
|
|||
$this->assertFieldByName('name', 'foo', 'Entered username has been kept.');
|
||||
$this->assertFieldByName('mail', 'bar@example.com', 'Entered mail address has been kept.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -53,20 +53,22 @@ class CheckboxTest extends WebTestBase {
|
|||
}
|
||||
}
|
||||
|
||||
// Ensure that $form_state->getValues() is populated correctly for a checkboxes
|
||||
// group that includes a 0-indexed array of options.
|
||||
$results = json_decode($this->drupalPostForm('form-test/checkboxes-zero', array(), 'Save'));
|
||||
// Ensure that $form_state->getValues() is populated correctly for a
|
||||
// checkboxes group that includes a 0-indexed array of options.
|
||||
$results = json_decode($this->drupalPostForm('form-test/checkboxes-zero/1', array(), 'Save'));
|
||||
$this->assertIdentical($results->checkbox_off, array(0, 0, 0), 'All three in checkbox_off are zeroes: off.');
|
||||
$this->assertIdentical($results->checkbox_zero_default, array('0', 0, 0), 'The first choice is on in checkbox_zero_default');
|
||||
$this->assertIdentical($results->checkbox_string_zero_default, array('0', 0, 0), 'The first choice is on in checkbox_string_zero_default');
|
||||
$edit = array('checkbox_off[0]' => '0');
|
||||
$results = json_decode($this->drupalPostForm('form-test/checkboxes-zero', $edit, 'Save'));
|
||||
$results = json_decode($this->drupalPostForm('form-test/checkboxes-zero/1', $edit, 'Save'));
|
||||
$this->assertIdentical($results->checkbox_off, array('0', 0, 0), 'The first choice is on in checkbox_off but the rest is not');
|
||||
|
||||
// Ensure that each checkbox is rendered correctly for a checkboxes group
|
||||
// that includes a 0-indexed array of options.
|
||||
$this->drupalPostForm('form-test/checkboxes-zero/0', array(), 'Save');
|
||||
$checkboxes = $this->xpath('//input[@type="checkbox"]');
|
||||
|
||||
$this->assertIdentical(count($checkboxes), 9, 'Correct number of checkboxes found.');
|
||||
foreach ($checkboxes as $checkbox) {
|
||||
$checked = isset($checkbox['checked']);
|
||||
$name = (string) $checkbox['name'];
|
||||
|
@ -75,10 +77,13 @@ class CheckboxTest extends WebTestBase {
|
|||
$edit = array('checkbox_off[0]' => '0');
|
||||
$this->drupalPostForm('form-test/checkboxes-zero/0', $edit, 'Save');
|
||||
$checkboxes = $this->xpath('//input[@type="checkbox"]');
|
||||
|
||||
$this->assertIdentical(count($checkboxes), 9, 'Correct number of checkboxes found.');
|
||||
foreach ($checkboxes as $checkbox) {
|
||||
$checked = isset($checkbox['checked']);
|
||||
$name = (string) $checkbox['name'];
|
||||
$this->assertIdentical($checked, $name == 'checkbox_off[0]' || $name == 'checkbox_zero_default[0]' || $name == 'checkbox_string_zero_default[0]', format_string('Checkbox %name correctly checked', array('%name' => $name)));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -146,4 +146,5 @@ class ElementsLabelsTest extends WebTestBase {
|
|||
|
||||
return $form;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -254,4 +254,5 @@ class ElementsTableSelectTest extends WebTestBase {
|
|||
// to allow the caller lowlevel access to the form.
|
||||
return array($form, $form_state, $errors);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -85,4 +85,5 @@ class ElementsVerticalTabsTest extends WebTestBase {
|
|||
$values = Json::decode($this->drupalPostForm('form_test/form-state-values-clean', [], t('Submit')));
|
||||
$this->assertFalse(isset($values['vertical_tabs__active_tab']), SafeMarkup::format('%element was removed.', ['%element' => 'vertical_tabs__active_tab']));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -45,4 +45,5 @@ class EmailTest extends WebTestBase {
|
|||
$this->assertEqual($values['email'], 'foo@example.com');
|
||||
$this->assertEqual($values['email_required'], 'example@drupal.org');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -113,4 +113,5 @@ class LanguageSelectElementTest extends WebTestBase {
|
|||
}
|
||||
$this->assertEqual($count, count($options), format_string('The number of languages and the number of options shown by the language element are the same: @languages languages, @number options', array('@languages' => count($options), '@number' => $count)));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -115,4 +115,5 @@ class ProgrammaticTest extends WebTestBase {
|
|||
$this->assertNotEqual($values['field_restricted'], 'dummy value', 'The value for the restricted field is not stored.');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -115,4 +115,5 @@ class RebuildTest extends WebTestBase {
|
|||
$url = parse_url($forms[0]['action'])['path'];
|
||||
$this->assertEqual(Url::fromRoute('node.add', ['node_type' => 'page'])->toString(), $url);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -102,4 +102,5 @@ class RedirectTest extends WebTestBase {
|
|||
$this->assertResponse(200);
|
||||
$this->assertUrl($expected, [], 'Redirected to correct URL/query.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -47,4 +47,5 @@ class StateValuesCleanAdvancedTest extends WebTestBase {
|
|||
$this->assertResponse(200, 'Received a 200 response for posted test file.');
|
||||
$this->assertRaw(t('You WIN!'), 'Found the success message.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -54,4 +54,5 @@ class StateValuesCleanTest extends WebTestBase {
|
|||
// Verify that actual form values equal resulting form values.
|
||||
$this->assertEqual($values, $result, 'Expected form values equal actual form values.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -93,4 +93,5 @@ class TriggeringElementTest extends WebTestBase {
|
|||
$this->assertNoText('The clicked button is button1.', '$form_state->getTriggeringElement() not set to a restricted button.');
|
||||
$this->assertText('The clicked button is button2.', '$form_state->getTriggeringElement() not set to a restricted button.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -46,4 +46,5 @@ class UrlTest extends WebTestBase {
|
|||
$this->assertEqual($values['url'], $edit['url']);
|
||||
$this->assertEqual($values['url_required'], $edit['url_required']);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -248,7 +248,7 @@ class ToolkitGdTest extends KernelTestBase {
|
|||
}
|
||||
|
||||
// Prepare a directory for test file results.
|
||||
$directory = $this->publicFilesDirectory .'/imagetest';
|
||||
$directory = $this->publicFilesDirectory . '/imagetest';
|
||||
file_prepare_directory($directory, FILE_CREATE_DIRECTORY);
|
||||
|
||||
foreach ($files as $file) {
|
||||
|
@ -378,7 +378,7 @@ class ToolkitGdTest extends KernelTestBase {
|
|||
if ($image_reloaded->getToolkit()->getType() == IMAGETYPE_GIF) {
|
||||
$this->assertEqual('#ffff00', $image_reloaded->getToolkit()->getTransparentColor(), SafeMarkup::format('Image file %file has the correct transparent color channel set.', array('%file' => $file)));
|
||||
}
|
||||
else {
|
||||
else {
|
||||
$this->assertEqual(NULL, $image_reloaded->getToolkit()->getTransparentColor(), SafeMarkup::format('Image file %file has no color channel set.', array('%file' => $file)));
|
||||
}
|
||||
}
|
||||
|
@ -424,7 +424,7 @@ class ToolkitGdTest extends KernelTestBase {
|
|||
*/
|
||||
function testGifTransparentImages() {
|
||||
// Prepare a directory for test file results.
|
||||
$directory = $this->publicFilesDirectory .'/imagetest';
|
||||
$directory = $this->publicFilesDirectory . '/imagetest';
|
||||
file_prepare_directory($directory, FILE_CREATE_DIRECTORY);
|
||||
|
||||
// Test loading an indexed GIF image with transparent color set.
|
||||
|
|
|
@ -70,4 +70,5 @@ class ToolkitSetupFormTest extends WebTestBase {
|
|||
$this->drupalGet('admin/config/media/image-toolkit');
|
||||
$this->assertResponse(403);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -150,4 +150,5 @@ abstract class ToolkitTestBase extends WebTestBase {
|
|||
function imageTestGetAllCalls() {
|
||||
return \Drupal::state()->get('image_test.results') ?: array();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -55,4 +55,5 @@ class InstallerLanguageTest extends KernelTestBase {
|
|||
$this->assertFalse(in_array('locale', $info_en['dependencies']), 'Locale is not set when installing in English.');
|
||||
$this->assertTrue(in_array('locale', $info_nl['dependencies']), 'Locale is set when installing in Dutch.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -147,8 +147,8 @@ ENDPO;
|
|||
$test_samples = ['Save and continue', 'Anonymous', 'Language'];
|
||||
$langcodes = ['de', 'es'];
|
||||
|
||||
foreach($test_samples as $sample) {
|
||||
foreach($langcodes as $langcode) {
|
||||
foreach ($test_samples as $sample) {
|
||||
foreach ($langcodes as $langcode) {
|
||||
$edit = array();
|
||||
$edit['langcode'] = $langcode;
|
||||
$edit['translation'] = 'translated';
|
||||
|
|
|
@ -95,7 +95,7 @@ class InstallerTranslationTest extends InstallerTestBase {
|
|||
|
||||
// Verify the strings from the translation files were imported.
|
||||
$test_samples = ['Save and continue', 'Anonymous'];
|
||||
foreach($test_samples as $sample) {
|
||||
foreach ($test_samples as $sample) {
|
||||
$edit = array();
|
||||
$edit['langcode'] = 'de';
|
||||
$edit['translation'] = 'translated';
|
||||
|
|
|
@ -132,7 +132,8 @@ class KeyValueContentEntityStorageTest extends KernelTestBase {
|
|||
try {
|
||||
$same_id->save();
|
||||
$this->fail('Not possible to overwrite an entity entity.');
|
||||
} catch (EntityStorageException $e) {
|
||||
}
|
||||
catch (EntityStorageException $e) {
|
||||
$this->pass('Not possible to overwrite an entity entity.');
|
||||
}
|
||||
|
||||
|
|
|
@ -67,4 +67,5 @@ class LockUnitTest extends KernelTestBase {
|
|||
$is_free = $this->lock->lockMayBeAvailable('lock_b');
|
||||
$this->assertTrue($is_free, 'Second lock has been released.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -383,4 +383,5 @@ class HtmlToTextTest extends WebTestBase {
|
|||
$mail_lines = explode("\n", MailFormatHelper::wrapMail($text));
|
||||
$this->assertEqual("--", $mail_lines[1], 'Trailing whitespace removed for incorrect dash-dash-space signatures.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -98,4 +98,5 @@ class MailTest extends WebTestBase {
|
|||
$this->assertFalse(isset($sent_message['headers']['Reply-to']), 'Message reply-to is not set if not specified.');
|
||||
$this->assertFalse(isset($sent_message['headers']['Errors-To']), 'Errors-to header must not be set, it is deprecated.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -205,7 +205,7 @@ class MenuRouterTest extends WebTestBase {
|
|||
/**
|
||||
* Make sure the maintenance mode can be bypassed using an EventSubscriber.
|
||||
*
|
||||
* @see \Drupal\menu_test\EventSubscriber\MaintenanceModeSubscriber::onKernelRequestMaintenance().
|
||||
* @see \Drupal\menu_test\EventSubscriber\MaintenanceModeSubscriber::onKernelRequestMaintenance()
|
||||
*/
|
||||
public function testMaintenanceModeLoginPaths() {
|
||||
$this->container->get('state')->set('system.maintenance_mode', TRUE);
|
||||
|
|
|
@ -47,4 +47,5 @@ class ClassLoaderTest extends WebTestBase {
|
|||
$this->assertNoText($this->expected, 'Autoloader does not load classes from a disabled module.');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -23,4 +23,5 @@ class HookRequirementsTest extends ModuleTestBase {
|
|||
$this->assertText(t('Requirements 1 Test failed requirements'), 'Modules status has been updated.');
|
||||
$this->assertModules(array('requirements1_test'), FALSE);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ abstract class ModuleTestBase extends WebTestBase {
|
|||
* TRUE if configuration has been installed, FALSE otherwise.
|
||||
*/
|
||||
function assertModuleConfig($module) {
|
||||
$module_config_dir = drupal_get_path('module', $module) . '/'. InstallStorage::CONFIG_INSTALL_DIRECTORY;
|
||||
$module_config_dir = drupal_get_path('module', $module) . '/' . InstallStorage::CONFIG_INSTALL_DIRECTORY;
|
||||
if (!is_dir($module_config_dir)) {
|
||||
return;
|
||||
}
|
||||
|
@ -190,4 +190,5 @@ abstract class ModuleTestBase extends WebTestBase {
|
|||
->fetchField();
|
||||
$this->assertTrue($count > 0, format_string('watchdog table contains @count rows for @message', array('@count' => $count, '@message' => format_string($message, $variables))));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -28,4 +28,5 @@ class RequiredTest extends ModuleTestBase {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -134,7 +134,8 @@ class UninstallTest extends WebTestBase {
|
|||
try {
|
||||
$this->container->get('module_installer')->install(array('module_installer_config_test'));
|
||||
$this->fail($message);
|
||||
} catch (EntityMalformedException $e) {
|
||||
}
|
||||
catch (EntityMalformedException $e) {
|
||||
$this->pass($message);
|
||||
}
|
||||
|
||||
|
|
|
@ -52,4 +52,5 @@ class VersionTest extends ModuleTestBase {
|
|||
$this->assertEqual(!empty($checkbox[0]['disabled']), $i % 2, $dependencies[$i]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -233,4 +233,5 @@ class PagerTest extends WebTestBase {
|
|||
}
|
||||
$this->assertTrue(strpos($element['class'], $class) === FALSE, $message);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ class UpcastingTest extends WebTestBase {
|
|||
$foo = 'bar';
|
||||
|
||||
// paramconverter_test/test_user_node_foo/{user}/{node}/{foo}
|
||||
$this->drupalGet("paramconverter_test/test_user_node_foo/" . $user->id() . '/' . $node->id() . "/$foo");
|
||||
$this->drupalGet("paramconverter_test/test_user_node_foo/" . $user->id() . '/' . $node->id() . "/$foo");
|
||||
$this->assertRaw("user: {$user->label()}, node: {$node->label()}, foo: $foo", 'user and node upcast by entity name');
|
||||
|
||||
// paramconverter_test/test_node_user_user/{node}/{foo}/{user}
|
||||
|
|
|
@ -28,4 +28,5 @@ abstract class PathUnitTestBase extends KernelTestBase {
|
|||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -93,4 +93,5 @@ class UrlAliasFixtures {
|
|||
|
||||
return $tables;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -107,4 +107,5 @@ class UrlAlterFunctionalTest extends WebTestBase {
|
|||
$result = $this->container->get('path.alias_manager')->getPathByAlias($original);
|
||||
return $this->assertIdentical($result, $final, format_string('Altered inbound URL %original, expected %final, and got %result.', array('%original' => $original, '%final' => $final, '%result' => $result)));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -137,4 +137,5 @@ class RequestPathTest extends KernelTestBase {
|
|||
$this->assertEqual($condition->summary(), 'Return true on the following pages: /my/pass/*', 'The condition summary matches for a wildcard path');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ class ContextPluginTest extends KernelTestBase {
|
|||
try {
|
||||
$plugin->getContextValue('user');
|
||||
}
|
||||
catch(ContextException $e) {
|
||||
catch (ContextException $e) {
|
||||
$this->assertIdentical("The 'entity:user' context is required and not present.", $e->getMessage(), 'Requesting a non-set value of a required context should throw a context exception.');
|
||||
}
|
||||
|
||||
|
@ -102,4 +102,5 @@ class ContextPluginTest extends KernelTestBase {
|
|||
// Test the title method for the complex context plugin.
|
||||
$this->assertEqual($user->label() . ' -- ' . $node->label(), $complex_plugin->getTitle());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Reference in a new issue