Skip to content
Snippets Groups Projects

Issue#3331903: Addressed phpcs issues.

Closes #3331903

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
101 102 $this->assertSession()->statusCodeEquals(200);
102 103 $this->drupalGet('user/' . $user->id() . '/message-subscribe/subscribe_node');
103 104 $this->assertSession()->statusCodeEquals(200);
104 $this->assertSession()->pageTextContains(t('You are not subscribed to any items.'));
105 $this->assertSession()->pageTextContains('You are not subscribed to any items.');
  • 2 2
    3 3 namespace Drupal\Tests\message_subscribe_email\Functional;
    4 4
    5 use Drupal\Core\StringTranslation\StringTranslationTrait;
  • 2 2
    3 3 namespace Drupal\Tests\message_subscribe_email\FunctionalJavascript;
    4 4
    5 use Drupal\Core\StringTranslation\StringTranslationTrait;
  • 1 1 name: 'Message subscribe email'
    2 description: 'Message subscribe email'
  • 87 85 );
    88 86 $debug && \Drupal::logger('message_subscribe_email')->debug(
    89 87 'Gathering email subscriptions using flags: @flags for users: @uids',
    90 ['@flags' => implode(', ', $flag_ids), '@uids' => implode(', ', array_keys($uids))]
    88 [
    89 '@flags' => implode(', ', $flag_ids),
    90 '@uids' => implode(', ', array_keys($uids)),
    91 ]
    91 92 );
  • 165 155
    166 156 // Create a message for the node author.
    167 157 $node = $comment->get('entity_id')->first()->get('entity')->getTarget()->getValue();
    168 $message = Message::create(['template' => 'create_comment', 'uid' => $node->getOwnerId()]);
    158 $message = Message::create([
    159 'template' => 'create_comment',
    160 'uid' => $node->getOwnerId(),
    161 ]);
  • 195 188 // or if you're automatically flagging administrators. It's just another
    196 189 // illustration of things that can be done.
    197 190 $query = \Drupal::entityQuery('user')
    198 ->condition('status', 1);
    191 ->condition('status', 1);
    199 192 $query->condition('roles', 'administrator');
  • 232 235 * {@inheritdoc}
    233 236 */
    234 237 public function validateForm(array &$form, FormStateInterface $form_state) {
    235 // TODO: Implement validateForm() method.
    238 // @todo Implement validateForm() method.
  • 115 118 ]);
    116 119
    117 120 // Place the subscription block.
    118 $this->placeBlock('message_subscribe_ui_block', ['label' => t('Manage subscriptions')]);
    121 $this->placeBlock('message_subscribe_ui_block', ['label' => $this->t('Manage subscriptions')]);
  • 16 17
    17 18 use TaxonomyTestTrait;
    18 19 use EntityReferenceTestTrait;
    20 use StringTranslationTrait;
  • 127 130
    128 131 // Check that the block is empty when viewing another user.
    129 132 $this->drupalGet($this->adminUser->toUrl());
    130 $this->assertSession()->pageTextNotContains(t('Manage subscriptions'));
    131 $this->assertSession()->pageTextNotContains(t('Subscribe to @label', ['@label' => $this->adminUser->getDisplayName()]));
    133 $this->assertSession()->pageTextNotContains($this->t('Manage subscriptions'));
    134 $this->assertSession()->pageTextNotContains($this->t('Subscribe to @label', ['@label' => $this->adminUser->getDisplayName()]));
    132 135
    133 136 $this->drupalGet($this->node->toUrl());
    134 $this->assertSession()->pageTextContains(t('Manage subscriptions'));
    137 $this->assertSession()->pageTextContains($this->t('Manage subscriptions'));
    135 138 foreach ([1, 3, 7, 9] as $i) {
    136 $this->assertSession()->pageTextContains(t('Subscribe to @title', ['@title' => $this->terms[$i]->label()]));
    139 $this->assertSession()->pageTextContains($this->t('Subscribe to @title', ['@title' => $this->terms[$i]->label()]));
  • 131 $this->assertSession()->pageTextNotContains(t('Subscribe to @label', ['@label' => $this->adminUser->getDisplayName()]));
    133 $this->assertSession()->pageTextNotContains($this->t('Manage subscriptions'));
    134 $this->assertSession()->pageTextNotContains($this->t('Subscribe to @label', ['@label' => $this->adminUser->getDisplayName()]));
    132 135
    133 136 $this->drupalGet($this->node->toUrl());
    134 $this->assertSession()->pageTextContains(t('Manage subscriptions'));
    137 $this->assertSession()->pageTextContains($this->t('Manage subscriptions'));
    135 138 foreach ([1, 3, 7, 9] as $i) {
    136 $this->assertSession()->pageTextContains(t('Subscribe to @title', ['@title' => $this->terms[$i]->label()]));
    139 $this->assertSession()->pageTextContains($this->t('Subscribe to @title', ['@title' => $this->terms[$i]->label()]));
    137 140 }
    138 141 // The subscription to the node itself should be available.
    139 $this->assertSession()->pageTextContains(t('Subscribe to @title', ['@title' => $this->node->label()]));
    140 $this->assertSession()->pageTextNotContains(t('Subscribe to @label', ['@label' => $this->adminUser->getDisplayName()]));
    142 $this->assertSession()->pageTextContains($this->t('Subscribe to @title', ['@title' => $this->node->label()]));
    143 $this->assertSession()->pageTextNotContains($this->t('Subscribe to @label', ['@label' => $this->adminUser->getDisplayName()]));
  • 136 $this->assertSession()->pageTextContains(t('Subscribe to @title', ['@title' => $this->terms[$i]->label()]));
    139 $this->assertSession()->pageTextContains($this->t('Subscribe to @title', ['@title' => $this->terms[$i]->label()]));
    137 140 }
    138 141 // The subscription to the node itself should be available.
    139 $this->assertSession()->pageTextContains(t('Subscribe to @title', ['@title' => $this->node->label()]));
    140 $this->assertSession()->pageTextNotContains(t('Subscribe to @label', ['@label' => $this->adminUser->getDisplayName()]));
    142 $this->assertSession()->pageTextContains($this->t('Subscribe to @title', ['@title' => $this->node->label()]));
    143 $this->assertSession()->pageTextNotContains($this->t('Subscribe to @label', ['@label' => $this->adminUser->getDisplayName()]));
    141 144
    142 145 // Subscribe to 1 and 7.
    143 146 $edit = [
    144 147 'subscriptions[taxonomy_term][' . $this->terms[1]->id() . ']' => TRUE,
    145 148 'subscriptions[taxonomy_term][' . $this->terms[7]->id() . ']' => TRUE,
    146 149 ];
    147 $this->submitForm($edit, t('Save'));
    150 $this->submitForm($edit, $this->t('Save'));
  • 152 155 $this->assertNotEmpty($this->flagService->getEntityFlaggings($flag, $term, $this->webUser));
    153 156
    154 157 // Subscriptions should be checked.
    155 $this->assertSession()->checkboxChecked(t('Subscribe to @label', ['@label' => $term->label()]));
    158 $this->assertSession()->checkboxChecked($this->t('Subscribe to @label', ['@label' => $term->label()]));
  • 170 173 $role->save();
    171 174
    172 175 $this->drupalGet($this->node->toUrl());
    173 $this->assertSession()->pageTextContains(t('Subscribe to @label', ['@label' => $this->adminUser->getDisplayName()]));
    176 $this->assertSession()->pageTextContains($this->t('Subscribe to @label', ['@label' => $this->adminUser->getDisplayName()]));
  • 170 173 $role->save();
    171 174
    172 175 $this->drupalGet($this->node->toUrl());
    173 $this->assertSession()->pageTextContains(t('Subscribe to @label', ['@label' => $this->adminUser->getDisplayName()]));
    176 $this->assertSession()->pageTextContains($this->t('Subscribe to @label', ['@label' => $this->adminUser->getDisplayName()]));
    174 177
    175 178 $this->drupalGet($this->adminUser->toUrl());
    176 $this->assertSession()->pageTextContains(t('Subscribe to @label', ['@label' => $this->adminUser->getDisplayName()]));
    179 $this->assertSession()->pageTextContains($this->t('Subscribe to @label', ['@label' => $this->adminUser->getDisplayName()]));
  • 170 173 $role->save();
    171 174
    172 175 $this->drupalGet($this->node->toUrl());
    173 $this->assertSession()->pageTextContains(t('Subscribe to @label', ['@label' => $this->adminUser->getDisplayName()]));
    176 $this->assertSession()->pageTextContains($this->t('Subscribe to @label', ['@label' => $this->adminUser->getDisplayName()]));
    174 177
    175 178 $this->drupalGet($this->adminUser->toUrl());
    176 $this->assertSession()->pageTextContains(t('Subscribe to @label', ['@label' => $this->adminUser->getDisplayName()]));
    179 $this->assertSession()->pageTextContains($this->t('Subscribe to @label', ['@label' => $this->adminUser->getDisplayName()]));
    177 180
    178 181 $edit = [
    179 182 'subscriptions[user][' . $this->adminUser->id() . ']' => TRUE,
    180 183 ];
    181 $this->submitForm($edit, t('Save'));
    184 $this->submitForm($edit, $this->t('Save'));
  • 176 $this->assertSession()->pageTextContains($this->t('Subscribe to @label', ['@label' => $this->adminUser->getDisplayName()]));
    174 177
    175 178 $this->drupalGet($this->adminUser->toUrl());
    176 $this->assertSession()->pageTextContains(t('Subscribe to @label', ['@label' => $this->adminUser->getDisplayName()]));
    179 $this->assertSession()->pageTextContains($this->t('Subscribe to @label', ['@label' => $this->adminUser->getDisplayName()]));
    177 180
    178 181 $edit = [
    179 182 'subscriptions[user][' . $this->adminUser->id() . ']' => TRUE,
    180 183 ];
    181 $this->submitForm($edit, t('Save'));
    184 $this->submitForm($edit, $this->t('Save'));
    182 185 $flag = $this->flagService->getFlagById('subscribe_user');
    183 186 $this->assertNotEmpty($this->flagService->getEntityFlaggings($flag, $this->adminUser, $this->webUser));
    184 187 // Subscriptions should be checked.
    185 $this->assertSession()->checkboxChecked(t('Subscribe to @label', ['@label' => $this->adminUser->getDisplayName()]));
    188 $this->assertSession()->checkboxChecked($this->t('Subscribe to @label', ['@label' => $this->adminUser->getDisplayName()]));
  • 193 196 $this->drupalGet($this->node->toUrl());
    194 197
    195 198 foreach ([1, 3, 7, 9] as $i) {
    196 $this->assertSession()->pageTextNotContains(t('Subscribe to @title', ['@title' => $this->terms[$i]->label()]));
    199 $this->assertSession()->pageTextNotContains($this->t('Subscribe to @title', ['@title' => $this->terms[$i]->label()]));
    197 200 }
    198 201 // The subscription to the node itself should not be available.
    199 $this->assertSession()->pageTextNotContains(t('Subscribe to @title', ['@title' => $this->node->label()]));
    200 $this->assertSession()->pageTextContains(t('Subscribe to @label', ['@label' => $this->adminUser->getDisplayName()]));
    202 $this->assertSession()->pageTextNotContains($this->t('Subscribe to @title', ['@title' => $this->node->label()]));
    203 $this->assertSession()->pageTextContains($this->t('Subscribe to @label', ['@label' => $this->adminUser->getDisplayName()]));
  • 2 2
    3 3 namespace Drupal\Tests\message_subscribe\Functional;
    4 4
    5 use Drupal\Core\StringTranslation\StringTranslationTrait;
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading