Commit 01382db4 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2416971 by dawehner, pwolanin: Remove Url::__toString()

parent 44323cf7
Loading
Loading
Loading
Loading
+0 −7
Changes for core/lib/Drupal/Core/Url.php: 0 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -739,13 +739,6 @@ public function toString() {
    return $this->urlGenerator()->generateFromRoute($this->getRouteName(), $this->getRouteParameters(), $this->getOptions());
  }

  /**
   * {@inheritdoc}
   */
  public function __toString() {
    return $this->toString();
  }

  /**
   * Returns the route information for a render array.
   *
+1 −1
Changes for core/modules/forum/src/Tests/ForumTest.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -117,7 +117,7 @@ function testForum() {
    //Check that the basic forum install creates a default forum topic
    $this->drupalGet('/forum');
    // Look for the "General discussion" default forum
    $this->assertRaw(t('<a href="'. Url::fromRoute('forum.page', ['taxonomy_term' => 1]) .'">General discussion</a>'), "Found the default forum at the /forum listing");
    $this->assertRaw(t('<a href="'. Url::fromRoute('forum.page', ['taxonomy_term' => 1])->toString() .'">General discussion</a>'), "Found the default forum at the /forum listing");

    // Do the admin tests.
    $this->doAdminTests($this->admin_user);
+1 −1
Changes for core/modules/locale/src/Tests/LocaleConfigTranslationImportTest.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ protected function setUp() {

    // Update module should not go out to d.o to check for updates. We override
    // the url to an invalid update source. No update data will be found.
    $this->config('update.settings')->set('fetch.url', (string) Url::fromRoute('<front>', array(), array('absolute' => TRUE)))->save();
    $this->config('update.settings')->set('fetch.url', (string) Url::fromRoute('<front>')->setAbsolute()->toString())->save();
  }

  /**
+1 −1
Changes for core/modules/node/src/Tests/NodeTranslationUITest.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -340,7 +340,7 @@ protected function doTestAlternateHreflangLinks(Url $url) {
        // Retrieve desired link elements from the HTML head.
        $links = $this->xpath('head/link[@rel = "alternate" and @href = :href and @hreflang = :hreflang]',
          array(':href' => $language_url->toString(), ':hreflang' => $alternate_langcode));
        $this->assert(isset($links[0]), format_string('The %langcode node translation has the correct alternate hreflang link for %alternate_langcode: %link.', array('%langcode' => $langcode, '%alternate_langcode' => $alternate_langcode, '%link' => $url)));
        $this->assert(isset($links[0]), format_string('The %langcode node translation has the correct alternate hreflang link for %alternate_langcode: %link.', array('%langcode' => $langcode, '%alternate_langcode' => $alternate_langcode, '%link' => $url->toString())));
      }
    }
  }
+7 −0
Changes for core/modules/simpletest/src/WebTestBase.php: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -1503,6 +1503,10 @@ protected function drupalGet($path, array $options = array(), array $headers = a
      $out = $new;
    }

    if ($path instanceof Url) {
      $path = $path->toString();
    }

    $verbose = 'GET request to: ' . $path .
               '<hr />Ending URL: ' . $this->getUrl();
    if ($this->dumpHeaders) {
@@ -1694,6 +1698,9 @@ protected function drupalPostForm($path, $edit, $submit, array $options = array(
            $out = $new;
          }

          if ($path instanceof Url) {
            $path = $path->toString();
          }
          $verbose = 'POST request to: ' . $path;
          $verbose .= '<hr />Ending URL: ' . $this->getUrl();
          if ($this->dumpHeaders) {
Loading