Unverified Commit 33700d01 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3193163 by mondrake, longwave: Deprecate AssertLegacyTrait::verbose and remove its usage

parent 82c63a2a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -149,8 +149,14 @@ protected function assertMailPattern($field_name, $regex, $message = '', $group
   *
   * @param int $count
   *   Optional number of emails to output.
   *
   * @deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. Use
   *   dump() instead.
   *
   * @see https://www.drupal.org/node/3197514
   */
  protected function verboseEmail($count = 1) {
    @trigger_error('AssertMailTrait::verboseEmail() is deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. Use dump() instead. See https://www.drupal.org/node/3197514', E_USER_DEPRECATED);
    $mails = $this->getMails();
    for ($i = count($mails) - 1; $i >= count($mails) - $count && $i >= 0; $i--) {
      $mail = $mails[$i];
+0 −7
Original line number Diff line number Diff line
@@ -161,7 +161,6 @@ protected function doTestFilters($display_id) {
    $executable = Views::getView('comment');
    $build = $executable->preview($display_id);
    $this->setRawContent($renderer->renderRoot($build));
    $this->verbose($this->getRawContent());

    // Assert the exposed filters on the admin page.
    $this->assertField('subject');
@@ -178,7 +177,6 @@ protected function doTestFilters($display_id) {
    $executable->setExposedInput(['subject' => 'Anonymous']);
    $build = $executable->preview($display_id);
    $this->setRawContent($renderer->renderRoot($build));
    $this->verbose($this->getRawContent());

    $elements = $this->cssSelect('input[type="checkbox"]');
    $this->assertCount(1, $elements, 'Only anonymous comment is visible.');
@@ -189,7 +187,6 @@ protected function doTestFilters($display_id) {
    $executable->setExposedInput(['subject' => 'My comment']);
    $build = $executable->preview($display_id);
    $this->setRawContent($renderer->renderRoot($build));
    $this->verbose($this->getRawContent());

    $elements = $this->cssSelect('input[type="checkbox"]');
    $this->assertCount(1, $elements, 'Only admin comment is visible.');
@@ -201,7 +198,6 @@ protected function doTestFilters($display_id) {
    $executable->setExposedInput(['author_name' => 'barry']);
    $build = $executable->preview($display_id);
    $this->setRawContent($renderer->renderRoot($build));
    $this->verbose($this->getRawContent());

    $elements = $this->cssSelect('input[type="checkbox"]');
    $this->assertCount(1, $elements, 'Only anonymous comment is visible.');
@@ -213,7 +209,6 @@ protected function doTestFilters($display_id) {
    $executable->setExposedInput(['author_name' => $this->adminUser->label()]);
    $build = $executable->preview($display_id);
    $this->setRawContent($renderer->renderRoot($build));
    $this->verbose($this->getRawContent());

    $elements = $this->cssSelect('input[type="checkbox"]');
    $this->assertCount(1, $elements, 'Only admin comment is visible.');
@@ -225,7 +220,6 @@ protected function doTestFilters($display_id) {
    $executable->setExposedInput(['langcode' => '***LANGUAGE_site_default***']);
    $build = $executable->preview($display_id);
    $this->setRawContent($renderer->renderRoot($build));
    $this->verbose($this->getRawContent());

    $elements = $this->cssSelect('input[type="checkbox"]');
    $this->assertCount(2, $elements, 'Both comments are visible.');
@@ -260,7 +254,6 @@ protected function doTestFilters($display_id) {
    $executable->setExposedInput(['langcode' => 'ur']);
    $build = $executable->preview($display_id);
    $this->setRawContent($renderer->renderRoot($build));
    $this->verbose($this->getRawContent());

    $elements = $this->cssSelect('input[type="checkbox"]');
    $this->assertCount(2, $elements, 'Both comments are visible.');
+0 −2
Original line number Diff line number Diff line
@@ -149,7 +149,6 @@ public function testUsername() {
    $executable = Views::getView($view_id);
    $build = $executable->preview();
    $this->setRawContent($renderer->renderRoot($build));
    $this->verbose($this->getRawContent());

    $this->assertLink('My comment title');
    $this->assertLink('Anonymous comment title');
@@ -174,7 +173,6 @@ public function testUsername() {
    $this->assertNoLink($this->adminUser->label());
    // Note: External users aren't pointing to drupal user profiles.
    $this->assertLink('barry (not verified)');
    $this->verbose($this->getRawContent());
    $this->assertLink('My comment title');
    $this->assertLink('Anonymous comment title');
  }
+0 −2
Original line number Diff line number Diff line
@@ -106,7 +106,6 @@ public function testSeparatorTranslation() {
    $display = EntityViewDisplay::collectRenderDisplay($entity, 'default');
    $build = $display->build($entity);
    $output = $this->container->get('renderer')->renderRoot($build);
    $this->verbose($output);
    $this->assertStringContainsString('UNTRANSLATED', (string) $output);

    // Translate the separator.
@@ -123,7 +122,6 @@ public function testSeparatorTranslation() {
    $display = EntityViewDisplay::collectRenderDisplay($entity, 'default');
    $build = $display->build($entity);
    $output = $this->container->get('renderer')->renderRoot($build);
    $this->verbose($output);
    $this->assertStringContainsString('NL_TRANSLATED!', (string) $output);
  }

+0 −3
Original line number Diff line number Diff line
@@ -68,17 +68,14 @@ public function testCheckMarkupFilterSubset() {
    $expected_filter_text_without_html_generators = "Text with evil content and a URL: https://www.drupal.org!";

    $actual_filtered_text = check_markup($text, 'filtered_html', '', []);
    $this->verbose("Actual:<pre>$actual_filtered_text</pre>Expected:<pre>$expected_filtered_text</pre>");
    $this->assertEqual($expected_filtered_text, $actual_filtered_text, 'Expected filter result.');
    $actual_filtered_text_without_html_generators = check_markup($text, 'filtered_html', '', [FilterInterface::TYPE_MARKUP_LANGUAGE]);
    $this->verbose("Actual:<pre>$actual_filtered_text_without_html_generators</pre>Expected:<pre>$expected_filter_text_without_html_generators</pre>");
    $this->assertEqual($expected_filter_text_without_html_generators, $actual_filtered_text_without_html_generators, 'Expected filter result when skipping FilterInterface::TYPE_MARKUP_LANGUAGE filters.');
    // Related to @see FilterSecurityTest.php/testSkipSecurityFilters(), but
    // this check focuses on the ability to filter multiple filter types at once.
    // Drupal core only ships with these two types of filters, so this is the
    // most extensive test possible.
    $actual_filtered_text_without_html_generators = check_markup($text, 'filtered_html', '', [FilterInterface::TYPE_HTML_RESTRICTOR, FilterInterface::TYPE_MARKUP_LANGUAGE]);
    $this->verbose("Actual:<pre>$actual_filtered_text_without_html_generators</pre>Expected:<pre>$expected_filter_text_without_html_generators</pre>");
    $this->assertEqual($expected_filter_text_without_html_generators, $actual_filtered_text_without_html_generators, 'Expected filter result when skipping FilterInterface::TYPE_MARKUP_LANGUAGE filters, even when trying to disable filters of the FilterInterface::TYPE_HTML_RESTRICTOR type.');
  }

Loading