Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / forum / tests / src / Unit / ForumUninstallValidatorTest.php
index fa1b0c1ec76a24de94e264841560a3a5823e2878..4969ad7dd34e9e06bb3758ccbe4cecb587b043cd 100644 (file)
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\forum\Unit;
 
+use Drupal\Core\Url;
 use Drupal\simpletest\AssertHelperTrait;
 use Drupal\Tests\UnitTestCase;
 
@@ -103,13 +104,16 @@ class ForumUninstallValidatorTest extends UnitTestCase {
       ->method('hasForumNodes')
       ->willReturn(TRUE);
 
+    $url = $this->prophesize(Url::class);
+    $url->toString()->willReturn('/path/to/vocabulary/overview');
+
     $vocabulary = $this->getMock('Drupal\taxonomy\VocabularyInterface');
     $vocabulary->expects($this->once())
       ->method('label')
       ->willReturn('Vocabulary label');
     $vocabulary->expects($this->once())
-      ->method('url')
-      ->willReturn('/path/to/vocabulary/overview');
+      ->method('toUrl')
+      ->willReturn($url->reveal());
     $vocabulary->expects($this->once())
       ->method('access')
       ->willReturn(TRUE);
@@ -143,7 +147,7 @@ class ForumUninstallValidatorTest extends UnitTestCase {
       ->method('label')
       ->willReturn('Vocabulary label');
     $vocabulary->expects($this->never())
-      ->method('url');
+      ->method('toUrl');
     $vocabulary->expects($this->once())
       ->method('access')
       ->willReturn(FALSE);
@@ -172,10 +176,13 @@ class ForumUninstallValidatorTest extends UnitTestCase {
       ->method('hasForumNodes')
       ->willReturn(FALSE);
 
+    $url = $this->prophesize(Url::class);
+    $url->toString()->willReturn('/path/to/vocabulary/overview');
+
     $vocabulary = $this->getMock('Drupal\taxonomy\VocabularyInterface');
     $vocabulary->expects($this->once())
-      ->method('url')
-      ->willReturn('/path/to/vocabulary/overview');
+      ->method('toUrl')
+      ->willReturn($url->reveal());
     $vocabulary->expects($this->once())
       ->method('label')
       ->willReturn('Vocabulary label');
@@ -211,7 +218,7 @@ class ForumUninstallValidatorTest extends UnitTestCase {
       ->method('label')
       ->willReturn('Vocabulary label');
     $vocabulary->expects($this->never())
-      ->method('url');
+      ->method('toUrl');
     $vocabulary->expects($this->once())
       ->method('access')
       ->willReturn(FALSE);