Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / views / tests / src / Functional / Handler / FieldEntityOperationsTest.php
index 653ce11527e370c2255ebef292d89f2bf72511de..7ced4f7071e0ac7b553251c55c86975872b4258f 100644 (file)
@@ -73,7 +73,10 @@ class FieldEntityOperationsTest extends ViewTestBase {
         $this->assertTrue(count($operations) > 0, 'There are operations.');
         foreach ($operations as $operation) {
           $expected_destination = Url::fromUri('internal:/test-entity-operations')->toString();
-          $result = $this->xpath('//ul[contains(@class, dropbutton)]/li/a[@href=:path and text()=:title]', [':path' => $operation['url']->toString() . '?destination=' . $expected_destination, ':title' => (string) $operation['title']]);
+          // Update destination property of the URL as generating it in the
+          // test would by default point to the frontpage.
+          $operation['url']->setOption('query', ['destination' => $expected_destination]);
+          $result = $this->xpath('//ul[contains(@class, dropbutton)]/li/a[@href=:path and text()=:title]', [':path' => $operation['url']->toString(), ':title' => (string) $operation['title']]);
           $this->assertEqual(count($result), 1, t('Found entity @operation link with destination parameter.', ['@operation' => $operation['title']]));
           // Entities which were created in Hungarian should link to the Hungarian
           // edit form, others to the English one (which has no path prefix here).