Commit cc30270e authored by xjm's avatar xjm

Revert "Revert "Revert "Issue #2715485 by harsha012, malavya, himanshu-dixit,...

Revert "Revert "Revert "Issue #2715485 by harsha012, malavya, himanshu-dixit, mfernea, vprocessor, tameeshb, Mile23, Jo Fitzgerald, klausi, xjm: Fix 'Drupal.Commenting.InlineComment.NoSpaceBefore' coding standard"""

This reverts commit b0675761.
parent 90d49768
...@@ -36,7 +36,7 @@ class Diff { ...@@ -36,7 +36,7 @@ class Diff {
public function __construct($from_lines, $to_lines) { public function __construct($from_lines, $to_lines) {
$eng = new DiffEngine(); $eng = new DiffEngine();
$this->edits = $eng->diff($from_lines, $to_lines); $this->edits = $eng->diff($from_lines, $to_lines);
// $this->_check($from_lines, $to_lines); //$this->_check($from_lines, $to_lines);
} }
/** /**
......
...@@ -299,8 +299,8 @@ protected function _compareseq($xoff, $xlim, $yoff, $ylim) { ...@@ -299,8 +299,8 @@ protected function _compareseq($xoff, $xlim, $yoff, $ylim) {
} }
else { else {
// This is ad hoc but seems to work well. // This is ad hoc but seems to work well.
// $nchunks = sqrt(min($xlim - $xoff, $ylim - $yoff) / 2.5); //$nchunks = sqrt(min($xlim - $xoff, $ylim - $yoff) / 2.5);
// $nchunks = max(2, min(8, (int)$nchunks)); //$nchunks = max(2, min(8, (int)$nchunks));
$nchunks = min(7, $xlim - $xoff, $ylim - $yoff) + 1; $nchunks = min(7, $xlim - $xoff, $ylim - $yoff) + 1;
list($lcs, $seps) = $this->_diag($xoff, $xlim, $yoff, $ylim, $nchunks); list($lcs, $seps) = $this->_diag($xoff, $xlim, $yoff, $ylim, $nchunks);
} }
......
...@@ -112,7 +112,7 @@ public static function open(array &$connection_options = []) { ...@@ -112,7 +112,7 @@ public static function open(array &$connection_options = []) {
// so backslashes in the password need to be doubled up. // so backslashes in the password need to be doubled up.
// The bug was reported against pdo_pgsql 1.0.2, backslashes in passwords // The bug was reported against pdo_pgsql 1.0.2, backslashes in passwords
// will break on this doubling up when the bug is fixed, so check the version // will break on this doubling up when the bug is fixed, so check the version
// elseif (phpversion('pdo_pgsql') < 'version_this_was_fixed_in') { //elseif (phpversion('pdo_pgsql') < 'version_this_was_fixed_in') {
else { else {
$connection_options['password'] = str_replace('\\', '\\\\', $connection_options['password']); $connection_options['password'] = str_replace('\\', '\\\\', $connection_options['password']);
} }
......
...@@ -37,7 +37,7 @@ interface StatementInterface extends \Traversable { ...@@ -37,7 +37,7 @@ interface StatementInterface extends \Traversable {
* "the access type must be omitted" if it is protected; i.e., conflicting * "the access type must be omitted" if it is protected; i.e., conflicting
* statements). The access type has to be protected. * statements). The access type has to be protected.
*/ */
// protected function __construct(Connection $dbh); //protected function __construct(Connection $dbh);
/** /**
* Executes a prepared statement * Executes a prepared statement
......
...@@ -108,7 +108,7 @@ public function chmodJailed($path, $mode, $recursive) { ...@@ -108,7 +108,7 @@ public function chmodJailed($path, $mode, $recursive) {
if ($this->isDirectory($path) && $recursive) { if ($this->isDirectory($path) && $recursive) {
$filelist = @ftp_nlist($this->connection, $path); $filelist = @ftp_nlist($this->connection, $path);
if (!$filelist) { if (!$filelist) {
// empty directory - returns false //empty directory - returns false
return; return;
} }
foreach ($filelist as $file) { foreach ($filelist as $file) {
......
...@@ -288,7 +288,7 @@ public function replyFormAccess(EntityInterface $entity, $field_name, $pid = NUL ...@@ -288,7 +288,7 @@ public function replyFormAccess(EntityInterface $entity, $field_name, $pid = NUL
// Check if the user has the proper permissions. // Check if the user has the proper permissions.
$access = $access->andIf(AccessResult::allowedIfHasPermission($account, 'access comments')); $access = $access->andIf(AccessResult::allowedIfHasPermission($account, 'access comments'));
// Load the parent comment. /// Load the parent comment.
$comment = $this->entityManager()->getStorage('comment')->load($pid); $comment = $this->entityManager()->getStorage('comment')->load($pid);
// Check if the parent comment is published and belongs to the entity. // Check if the parent comment is published and belongs to the entity.
$access = $access->andIf(AccessResult::allowedIf($comment && $comment->isPublished() && $comment->getCommentedEntityId() == $entity->id())); $access = $access->andIf(AccessResult::allowedIf($comment && $comment->isPublished() && $comment->getCommentedEntityId() == $entity->id()));
......
...@@ -16,14 +16,14 @@ class Thread extends SortPluginBase { ...@@ -16,14 +16,14 @@ class Thread extends SortPluginBase {
public function query() { public function query() {
$this->ensureMyTable(); $this->ensureMyTable();
// Read comment_render() in comment.module for an explanation of the //Read comment_render() in comment.module for an explanation of the
// thinking behind this sort. //thinking behind this sort.
if ($this->options['order'] == 'DESC') { if ($this->options['order'] == 'DESC') {
$this->query->addOrderBy($this->tableAlias, $this->realField, $this->options['order']); $this->query->addOrderBy($this->tableAlias, $this->realField, $this->options['order']);
} }
else { else {
$alias = $this->tableAlias . '_' . $this->realField . 'asc'; $alias = $this->tableAlias . '_' . $this->realField . 'asc';
// @todo is this secure? //@todo is this secure?
$this->query->addOrderBy(NULL, "SUBSTRING({$this->tableAlias}.{$this->realField}, 1, (LENGTH({$this->tableAlias}.{$this->realField}) - 1))", $this->options['order'], $alias); $this->query->addOrderBy(NULL, "SUBSTRING({$this->tableAlias}.{$this->realField}, 1, (LENGTH({$this->tableAlias}.{$this->realField}) - 1))", $this->options['order'], $alias);
} }
} }
......
...@@ -234,7 +234,7 @@ public function getSendMailMessages() { ...@@ -234,7 +234,7 @@ public function getSendMailMessages() {
$results[] = $result + $default_result; $results[] = $result + $default_result;
$data[] = [$message, $sender, $results]; $data[] = [$message, $sender, $results];
// For authenticated user. //For authenticated user.
$results = []; $results = [];
$message = $this->getAuthenticatedMockMessage(); $message = $this->getAuthenticatedMockMessage();
$sender = $this->getMockSender(FALSE, 'user@drupal.org'); $sender = $this->getMockSender(FALSE, 'user@drupal.org');
......
...@@ -213,17 +213,17 @@ public function testMultipleTargetBundles() { ...@@ -213,17 +213,17 @@ public function testMultipleTargetBundles() {
// a way to catch and assert user-triggered errors. // a way to catch and assert user-triggered errors.
// Test the case when the field config settings are inconsistent. // Test the case when the field config settings are inconsistent.
// unset($handler_settings['auto_create_bundle']); //unset($handler_settings['auto_create_bundle']);
// $field_config->setSetting('handler_settings', $handler_settings); //$field_config->setSetting('handler_settings', $handler_settings);
// $field_config->save(); //$field_config->save();
// //
// $this->drupalGet('node/add/' . $this->referencingType); //$this->drupalGet('node/add/' . $this->referencingType);
// $error_message = sprintf( //$error_message = sprintf(
// "Create referenced entities if they don't already exist option is enabled but a specific destination bundle is not set. You should re-visit and fix the settings of the '%s' (%s) field.", // "Create referenced entities if they don't already exist option is enabled but a specific destination bundle is not set. You should re-visit and fix the settings of the '%s' (%s) field.",
// $field_config->getLabel(), // $field_config->getLabel(),
// $field_config->getName() // $field_config->getName()
// ); //);
// $this->assertErrorLogged($error_message); //$this->assertErrorLogged($error_message);
} }
} }
...@@ -272,7 +272,7 @@ public function testDataTableRelationshipWithLongFieldName() { ...@@ -272,7 +272,7 @@ public function testDataTableRelationshipWithLongFieldName() {
$this->assertEqual($row->_entity->id(), $this->entities[$index]->id()); $this->assertEqual($row->_entity->id(), $this->entities[$index]->id());
// Test the forward relationship. // Test the forward relationship.
// $this->assertEqual($row->entity_test_entity_test_mul__field_data_test_id, 1); //$this->assertEqual($row->entity_test_entity_test_mul__field_data_test_id, 1);
// Test that the correct relationship entity is on the row. // Test that the correct relationship entity is on the row.
$this->assertEqual($row->_relationship_entities['field_test_data_with_a_long_name']->id(), 1); $this->assertEqual($row->_relationship_entities['field_test_data_with_a_long_name']->id(), 1);
......
...@@ -93,7 +93,7 @@ public function testNumberItem() { ...@@ -93,7 +93,7 @@ public function testNumberItem() {
$this->assertEqual($entity->field_float->value, $new_float); $this->assertEqual($entity->field_float->value, $new_float);
$this->assertEqual($entity->field_decimal->value, $new_decimal); $this->assertEqual($entity->field_decimal->value, $new_decimal);
// Test sample item generation. /// Test sample item generation.
$entity = EntityTest::create(); $entity = EntityTest::create();
$entity->field_integer->generateSampleItems(); $entity->field_integer->generateSampleItems();
$entity->field_float->generateSampleItems(); $entity->field_float->generateSampleItems();
......
...@@ -496,8 +496,8 @@ function _filter_url($text, $filter) { ...@@ -496,8 +496,8 @@ function _filter_url($text, $filter) {
$valid_url_query_chars = '[a-zA-Z0-9!?\*\'@\(\);:&=\+\$\/%#\[\]\-_\.,~|]'; $valid_url_query_chars = '[a-zA-Z0-9!?\*\'@\(\);:&=\+\$\/%#\[\]\-_\.,~|]';
$valid_url_query_ending_chars = '[a-zA-Z0-9_&=#\/]'; $valid_url_query_ending_chars = '[a-zA-Z0-9_&=#\/]';
// full path //full path
// and allow @ in a url, but only in the middle. Catch things like http://example.com/@user/ //and allow @ in a url, but only in the middle. Catch things like http://example.com/@user/
$valid_url_path = '(?:(?:' . $valid_url_path_characters . '*(?:' . $valid_url_balanced_parens . $valid_url_path_characters . '*)*' . $valid_url_ending_characters . ')|(?:@' . $valid_url_path_characters . '+\/))'; $valid_url_path = '(?:(?:' . $valid_url_path_characters . '*(?:' . $valid_url_balanced_parens . $valid_url_path_characters . '*)*' . $valid_url_ending_characters . ')|(?:@' . $valid_url_path_characters . '+\/))';
// Prepare domain name pattern. // Prepare domain name pattern.
......
...@@ -118,7 +118,7 @@ protected function setUp() { ...@@ -118,7 +118,7 @@ protected function setUp() {
* Tests forum functionality through the admin and user interfaces. * Tests forum functionality through the admin and user interfaces.
*/ */
public function testForum() { public function testForum() {
// Check that the basic forum install creates a default forum topic //Check that the basic forum install creates a default forum topic
$this->drupalGet('/forum'); $this->drupalGet('/forum');
// Look for the "General discussion" default forum // Look for the "General discussion" default forum
$this->assertRaw(Link::createFromRoute(t('General discussion'), 'forum.page', ['taxonomy_term' => 1])->toString(), "Found the default forum at the /forum listing"); $this->assertRaw(Link::createFromRoute(t('General discussion'), 'forum.page', ['taxonomy_term' => 1])->toString(), "Found the default forum at the /forum listing");
......
...@@ -572,7 +572,7 @@ public function setProcessOfProperty($property, $process_of_property) { ...@@ -572,7 +572,7 @@ public function setProcessOfProperty($property, $process_of_property) {
*/ */
public function mergeProcessOfProperty($property, array $process_of_property) { public function mergeProcessOfProperty($property, array $process_of_property) {
// If we already have a process value then merge the incoming process array // If we already have a process value then merge the incoming process array
// otherwise simply set it. //otherwise simply set it.
$current_process = $this->getProcess(); $current_process = $this->getProcess();
if (isset($current_process[$property])) { if (isset($current_process[$property])) {
$this->process = NestedArray::mergeDeepArray([$current_process, $this->getProcessNormalized([$property => $process_of_property])], TRUE); $this->process = NestedArray::mergeDeepArray([$current_process, $this->getProcessNormalized([$property => $process_of_property])], TRUE);
......
...@@ -172,7 +172,7 @@ public function testEditorWithCustomMetadata() { ...@@ -172,7 +172,7 @@ public function testEditorWithCustomMetadata() {
'format' => 'full_html' 'format' => 'full_html'
], ],
]; ];
$this->assertEqual($expected, $metadata); // , 'The correct metadata (including custom metadata) is generated.'); $this->assertEqual($expected, $metadata); //, 'The correct metadata (including custom metadata) is generated.');
} }
} }
...@@ -125,23 +125,23 @@ public function testNodeTeaser() { ...@@ -125,23 +125,23 @@ public function testNodeTeaser() {
'value' => 'http://www.w3.org/2004/02/skos/core#Concept', 'value' => 'http://www.w3.org/2004/02/skos/core#Concept',
]; ];
// @todo Enable with https://www.drupal.org/node/2072791. // @todo Enable with https://www.drupal.org/node/2072791.
// $this->assertTrue($graph->hasProperty($taxonomy_term_1_uri, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', $expected_value), 'Taxonomy term type found in RDF output (skos:Concept).'); //$this->assertTrue($graph->hasProperty($taxonomy_term_1_uri, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', $expected_value), 'Taxonomy term type found in RDF output (skos:Concept).');
$expected_value = [ $expected_value = [
'type' => 'literal', 'type' => 'literal',
'value' => $term1->getName(), 'value' => $term1->getName(),
]; ];
// $this->assertTrue($graph->hasProperty($taxonomy_term_1_uri, 'http://www.w3.org/2000/01/rdf-schema#label', $expected_value), 'Taxonomy term name found in RDF output (rdfs:label).'); //$this->assertTrue($graph->hasProperty($taxonomy_term_1_uri, 'http://www.w3.org/2000/01/rdf-schema#label', $expected_value), 'Taxonomy term name found in RDF output (rdfs:label).');
// Term 2. // Term 2.
$expected_value = [ $expected_value = [
'type' => 'uri', 'type' => 'uri',
'value' => 'http://www.w3.org/2004/02/skos/core#Concept', 'value' => 'http://www.w3.org/2004/02/skos/core#Concept',
]; ];
// $this->assertTrue($graph->hasProperty($taxonomy_term_2_uri, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', $expected_value), 'Taxonomy term type found in RDF output (skos:Concept).'); //$this->assertTrue($graph->hasProperty($taxonomy_term_2_uri, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', $expected_value), 'Taxonomy term type found in RDF output (skos:Concept).');
$expected_value = [ $expected_value = [
'type' => 'literal', 'type' => 'literal',
'value' => $term2->getName(), 'value' => $term2->getName(),
]; ];
// $this->assertTrue($graph->hasProperty($taxonomy_term_2_uri, 'http://www.w3.org/2000/01/rdf-schema#label', $expected_value), 'Taxonomy term name found in RDF output (rdfs:label).'); //$this->assertTrue($graph->hasProperty($taxonomy_term_2_uri, 'http://www.w3.org/2000/01/rdf-schema#label', $expected_value), 'Taxonomy term name found in RDF output (rdfs:label).');
} }
} }
...@@ -407,7 +407,7 @@ protected function assertRdfaArticleProperties($graph, $message_prefix) { ...@@ -407,7 +407,7 @@ protected function assertRdfaArticleProperties($graph, $message_prefix) {
// Tag type. // Tag type.
// @todo Enable with https://www.drupal.org/node/2072791. // @todo Enable with https://www.drupal.org/node/2072791.
// $this->assertEqual($graph->type($this->termUri), 'schema:Thing', 'Tag type was found (schema:Thing).'); //$this->assertEqual($graph->type($this->termUri), 'schema:Thing', 'Tag type was found (schema:Thing).');
// Tag name. // Tag name.
$expected_value = [ $expected_value = [
...@@ -416,7 +416,7 @@ protected function assertRdfaArticleProperties($graph, $message_prefix) { ...@@ -416,7 +416,7 @@ protected function assertRdfaArticleProperties($graph, $message_prefix) {
'lang' => 'en', 'lang' => 'en',
]; ];
// @todo Enable with https://www.drupal.org/node/2072791. // @todo Enable with https://www.drupal.org/node/2072791.
// $this->assertTrue($graph->hasProperty($this->termUri, 'http://schema.org/name', $expected_value), "$message_prefix name was found (schema:name)."); //$this->assertTrue($graph->hasProperty($this->termUri, 'http://schema.org/name', $expected_value), "$message_prefix name was found (schema:name).");
} }
/** /**
......
...@@ -279,7 +279,7 @@ public function testPostDxWithoutCriticalBaseFields() { ...@@ -279,7 +279,7 @@ public function testPostDxWithoutCriticalBaseFields() {
$this->assertSame(500, $response->getStatusCode()); $this->assertSame(500, $response->getStatusCode());
$this->assertSame(['text/plain; charset=UTF-8'], $response->getHeader('Content-Type')); $this->assertSame(['text/plain; charset=UTF-8'], $response->getHeader('Content-Type'));
$this->assertStringStartsWith('The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">Symfony\Component\HttpKernel\Exception\HttpException</em>: Internal Server Error in <em class="placeholder">Drupal\rest\Plugin\rest\resource\EntityResource-&gt;post()</em>', (string) $response->getBody()); $this->assertStringStartsWith('The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">Symfony\Component\HttpKernel\Exception\HttpException</em>: Internal Server Error in <em class="placeholder">Drupal\rest\Plugin\rest\resource\EntityResource-&gt;post()</em>', (string) $response->getBody());
// $this->assertResourceErrorResponse(422, "Unprocessable Entity: validation failed.\nentity_type: This value should not be null.\n", $response); //$this->assertResourceErrorResponse(422, "Unprocessable Entity: validation failed.\nentity_type: This value should not be null.\n", $response);
// DX: 422 when missing 'entity_id' field. // DX: 422 when missing 'entity_id' field.
$request_options[RequestOptions::BODY] = $this->serializer->encode(array_diff_key($this->getNormalizedPostEntity(), ['entity_id' => TRUE]), static::$format); $request_options[RequestOptions::BODY] = $this->serializer->encode(array_diff_key($this->getNormalizedPostEntity(), ['entity_id' => TRUE]), static::$format);
...@@ -288,14 +288,14 @@ public function testPostDxWithoutCriticalBaseFields() { ...@@ -288,14 +288,14 @@ public function testPostDxWithoutCriticalBaseFields() {
try { try {
$response = $this->request('POST', $url, $request_options); $response = $this->request('POST', $url, $request_options);
// This happens on DrupalCI. // This happens on DrupalCI.
// $this->assertSame(500, $response->getStatusCode()); //$this->assertSame(500, $response->getStatusCode());
} }
catch (\Exception $e) { catch (\Exception $e) {
// This happens on Wim's local machine. // This happens on Wim's local machine.
// $this->assertSame("Error: Call to a member function get() on null\nDrupal\\comment\\Plugin\\Validation\\Constraint\\CommentNameConstraintValidator->getAnonymousContactDetailsSetting()() (Line: 96)\n", $e->getMessage()); //$this->assertSame("Error: Call to a member function get() on null\nDrupal\\comment\\Plugin\\Validation\\Constraint\\CommentNameConstraintValidator->getAnonymousContactDetailsSetting()() (Line: 96)\n", $e->getMessage());
} }
// $response = $this->request('POST', $url, $request_options); //$response = $this->request('POST', $url, $request_options);
// $this->assertResourceErrorResponse(422, "Unprocessable Entity: validation failed.\nentity_type: This value should not be null.\n", $response); //$this->assertResourceErrorResponse(422, "Unprocessable Entity: validation failed.\nentity_type: This value should not be null.\n", $response);
// DX: 422 when missing 'entity_type' field. // DX: 422 when missing 'entity_type' field.
$request_options[RequestOptions::BODY] = $this->serializer->encode(array_diff_key($this->getNormalizedPostEntity(), ['field_name' => TRUE]), static::$format); $request_options[RequestOptions::BODY] = $this->serializer->encode(array_diff_key($this->getNormalizedPostEntity(), ['field_name' => TRUE]), static::$format);
...@@ -303,7 +303,7 @@ public function testPostDxWithoutCriticalBaseFields() { ...@@ -303,7 +303,7 @@ public function testPostDxWithoutCriticalBaseFields() {
// @todo Uncomment, remove next 2 lines in https://www.drupal.org/node/2820364. // @todo Uncomment, remove next 2 lines in https://www.drupal.org/node/2820364.
$this->assertSame(500, $response->getStatusCode()); $this->assertSame(500, $response->getStatusCode());
$this->assertSame(['text/plain; charset=UTF-8'], $response->getHeader('Content-Type')); $this->assertSame(['text/plain; charset=UTF-8'], $response->getHeader('Content-Type'));
// $this->assertResourceErrorResponse(422, "Unprocessable Entity: validation failed.\nfield_name: This value should not be null.\n", $response); //$this->assertResourceErrorResponse(422, "Unprocessable Entity: validation failed.\nfield_name: This value should not be null.\n", $response);
} }
/** /**
......
...@@ -89,7 +89,7 @@ public function testAttemptAccessControlBypass() { ...@@ -89,7 +89,7 @@ public function testAttemptAccessControlBypass() {
// Ensure that the triggering element was not set to the restricted button. // Ensure that the triggering element was not set to the restricted button.
// Do this with both a negative and positive assertion, because negative // Do this with both a negative and positive assertion, because negative
// assertions alone can be brittle. See testNoButtonInfoInPost() for why the // assertions alone can be brittle. See testNoButtonInfoInPost() for why the
// triggering element gets set to 'button2'. //triggering element gets set to 'button2'.
$this->assertNoText('The clicked button is button1.', '$form_state->getTriggeringElement() not set to a restricted button.'); $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.'); $this->assertText('The clicked button is button2.', '$form_state->getTriggeringElement() not set to a restricted button.');
} }
......
...@@ -60,7 +60,7 @@ public function _writeDirectory($base, $files = []) { ...@@ -60,7 +60,7 @@ public function _writeDirectory($base, $files = []) {
$this->_writeDirectory($base . DIRECTORY_SEPARATOR . $key, $file); $this->_writeDirectory($base . DIRECTORY_SEPARATOR . $key, $file);
} }
else { else {
// just write the filename into the file //just write the filename into the file
file_put_contents($base . DIRECTORY_SEPARATOR . $file, $file); file_put_contents($base . DIRECTORY_SEPARATOR . $file, $file);
} }
} }
......
...@@ -349,7 +349,7 @@ function update_get_available($refresh = FALSE) { ...@@ -349,7 +349,7 @@ function update_get_available($refresh = FALSE) {
foreach ($projects as $key => $project) { foreach ($projects as $key => $project) {
// If there's no data at all, we clearly need to fetch some. // If there's no data at all, we clearly need to fetch some.
if (empty($available[$key])) { if (empty($available[$key])) {
// update_create_fetch_task($project); //update_create_fetch_task($project);
\Drupal::service('update.processor')->createFetchTask($project); \Drupal::service('update.processor')->createFetchTask($project);
$needs_refresh = TRUE; $needs_refresh = TRUE;
continue; continue;
......
...@@ -128,8 +128,8 @@ public function testRenderCaching() { ...@@ -128,8 +128,8 @@ public function testRenderCaching() {
// @todo Fix this in https://www.drupal.org/node/2551037, // @todo Fix this in https://www.drupal.org/node/2551037,
// DisplayPluginBase::applyDisplayCacheabilityMetadata() is not invoked when // DisplayPluginBase::applyDisplayCacheabilityMetadata() is not invoked when
// using buildBasicRenderable() and a Views access plugin returns FALSE. // using buildBasicRenderable() and a Views access plugin returns FALSE.
// $this->assertTrue(in_array('user.roles', $build['#cache']['contexts'])); //$this->assertTrue(in_array('user.roles', $build['#cache']['contexts']));
// $this->assertEqual([], $build['#cache']['tags']); //$this->assertEqual([], $build['#cache']['tags']);
$this->assertEqual(Cache::PERMANENT, $build['#cache']['max-age']); $this->assertEqual(Cache::PERMANENT, $build['#cache']['max-age']);
$this->assertEqual($result, ''); $this->assertEqual($result, '');
} }
......
...@@ -351,7 +351,7 @@ protected function viewsTokenReplace($text, $tokens) { ...@@ -351,7 +351,7 @@ protected function viewsTokenReplace($text, $tokens) {
foreach ($tokens as $token => $replacement) { foreach ($tokens as $token => $replacement) {
// Twig wants a token replacement array stripped of curly-brackets. // Twig wants a token replacement array stripped of curly-brackets.
// Some Views tokens come with curly-braces, others do not. // Some Views tokens come with curly-braces, others do not.
// @todo: https://www.drupal.org/node/2544392 //@todo: https://www.drupal.org/node/2544392
if (strpos($token, '{{') !== FALSE) { if (strpos($token, '{{') !== FALSE) {
// Twig wants a token replacement array stripped of curly-brackets. // Twig wants a token replacement array stripped of curly-brackets.
$token = trim(str_replace(['{{', '}}'], '', $token)); $token = trim(str_replace(['{{', '}}'], '', $token));
......
...@@ -131,7 +131,7 @@ public function testArgumentDefaultFixed() { ...@@ -131,7 +131,7 @@ public function testArgumentDefaultFixed() {
/** /**
* @todo Test php default argument. * @todo Test php default argument.
*/ */
// function testArgumentDefaultPhp() {} //function testArgumentDefaultPhp() {}
/** /**
* Test node default argument. * Test node default argument.
......
...@@ -42,7 +42,7 @@ protected function setUp($import_test_views = TRUE) { ...@@ -42,7 +42,7 @@ protected function setUp($import_test_views = TRUE) {
$this->installEntitySchema('node'); $this->installEntitySchema('node');
$this->installEntitySchema('user'); $this->installEntitySchema('user');
// $this->installConfig('node'); //$this->installConfig('node');
$this->container->get('kernel')->rebuildContainer(); $this->container->get('kernel')->rebuildContainer();
$node_type = NodeType::create(['type' => 'article']); $node_type = NodeType::create(['type' => 'article']);
......
...@@ -311,7 +311,7 @@ public function testBuildThemeFunctions() { ...@@ -311,7 +311,7 @@ public function testBuildThemeFunctions() {
]; ];
$this->assertEquals($expected, $view->buildThemeFunctions('test_hook')); $this->assertEquals($expected, $view->buildThemeFunctions('test_hook'));
// Change the name of the display plugin and make sure that is in the array. //Change the name of the display plugin and make sure that is in the array.
$view->display_handler->display['display_plugin'] = 'default2'; $view->display_handler->display['display_plugin'] = 'default2';
$expected = [ $expected = [
......
...@@ -77,15 +77,6 @@ ...@@ -77,15 +77,6 @@
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/InfoFiles/ClassFilesSniff.php"/> <rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/InfoFiles/ClassFilesSniff.php"/>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/InfoFiles/DuplicateEntrySniff.php"/> <rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/InfoFiles/DuplicateEntrySniff.php"/>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/InfoFiles/RequiredSniff.php"/> <rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/InfoFiles/RequiredSniff.php"/>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Commenting/InlineCommentSniff.php">
<!-- Sniff for: NoSpaceBefore -->
<exclude name="Drupal.Commenting.InlineComment.DocBlock"/>
<exclude name="Drupal.Commenting.InlineComment.InvalidEndChar"/>
<exclude name="Drupal.Commenting.InlineComment.NotCapital"/>
<exclude name="Drupal.Commenting.InlineComment.SpacingAfter"/>
<exclude name="Drupal.Commenting.InlineComment.SpacingBefore"/>
<exclude name="Drupal.Commenting.InlineComment.WrongStyle"/>
</rule>
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Methods/MethodDeclarationSniff.php"> <rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Methods/MethodDeclarationSniff.php">
<!-- Silence method name underscore warning which is covered already in <!-- Silence method name underscore warning which is covered already in
Drupal.NamingConventions.ValidFunctionName.ScopeNotCamelCaps. --> Drupal.NamingConventions.ValidFunctionName.ScopeNotCamelCaps. -->
......
...@@ -504,7 +504,7 @@ public function testSchemaFallback() { ...@@ -504,7 +504,7 @@ public function testSchemaFallback() {
$definition2 = \Drupal::service('config.typed')->getDefinition('config_schema_test.wildcard_fallback.something.something'); $definition2 = \Drupal::service('config.typed')->getDefinition('config_schema_test.wildcard_fallback.something.something');
// This should be the schema of config_schema_test.wildcard_fallback.* as // This should be the schema of config_schema_test.wildcard_fallback.* as
// well. //well.
$this->assertSame($definition, $definition2); $this->assertSame($definition, $definition2);
} }
......
...@@ -64,7 +64,7 @@ public function testEnableTargetLogging() { ...@@ -64,7 +64,7 @@ public function testEnableTargetLogging() {
db_query('SELECT name FROM {test} WHERE age > :age', [':age' => 25])->fetchCol(); db_query('SELECT name FROM {test} WHERE age > :age', [':age' => 25])->fetchCol();
db_query('SELECT age FROM {test} WHERE name = :name', [':name' => 'Ringo'], ['target' => 'replica']);// ->fetchCol(); db_query('SELECT age FROM {test} WHERE name = :name', [':name' => 'Ringo'], ['target' => 'replica']);//->fetchCol();
$queries1 = Database::getLog('testing1'); $queries1 = Database::getLog('testing1');
......
...@@ -353,7 +353,7 @@ public function testEntityAutocompleteAccess() { ...@@ -353,7 +353,7 @@ public function testEntityAutocompleteAccess() {
public function testEntityAutocompleteIdInput() { public function testEntityAutocompleteIdInput() {
/** @var \Drupal\Core\Form\FormBuilderInterface $form_builder */ /** @var \Drupal\Core\Form\FormBuilderInterface $form_builder */
$form_builder = $this->container->get('form_builder'); $form_builder = $this->container->get('form_builder');
// $form = $form_builder->getForm($this); //$form = $form_builder->getForm($this);
$form_state = (new FormState()) $form_state = (new FormState())
->setMethod('GET') ->setMethod('GET')
->setValues([ ->setValues([
......
...@@ -115,7 +115,7 @@ public function testEntityTypeUpdateWithoutData() { ...@@ -115,7 +115,7 @@ public function testEntityTypeUpdateWithoutData() {
t('The %field_name field needs to be installed.', ['%field_name' => 'Revision ID']), t('The %field_name field needs to be installed.', ['%field_name' => 'Revision ID']),
], ],
]; ];
$this->assertEqual($this->entityDefinitionUpdateManager->getChangeSummary(), $expected); // , 'EntityDefinitionUpdateManager reports the expected change summary.'); $this->assertEqual($this->entityDefinitionUpdateManager->getChangeSummary(), $expected); //, 'EntityDefinitionUpdateManager reports the expected change summary.');
// Run the update and ensure the revision table is created. // Run the update and ensure the revision table is created.
$this->entityDefinitionUpdateManager->applyUpdates(); $this->entityDefinitionUpdateManager->applyUpdates();
......
...@@ -16,16 +16,16 @@ ...@@ -16,16 +16,16 @@
class AliasTest extends PathUnitTestBase { class AliasTest extends PathUnitTestBase {
public function testCRUD() { public function testCRUD() {
// Prepare database table. //Prepare database table.
$connection = Database::getConnection(); $connection = Database::getConnection();
$this->fixtures->createTables($connection); $this->fixtures->createTables($connection);
// Create Path object. //Create Path object.
$aliasStorage = new AliasStorage($connection, $this->container->get('module_handler')); $aliasStorage = new AliasStorage($connection, $this->container->get('module_handler'));