namespace Drupal\Tests\forum\Unit;
+use Drupal\Core\Url;
use Drupal\simpletest\AssertHelperTrait;
use Drupal\Tests\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);
->method('label')
->willReturn('Vocabulary label');
$vocabulary->expects($this->never())
- ->method('url');
+ ->method('toUrl');
$vocabulary->expects($this->once())
->method('access')
->willReturn(FALSE);
->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');
->method('label')
->willReturn('Vocabulary label');
$vocabulary->expects($this->never())
- ->method('url');
+ ->method('toUrl');
$vocabulary->expects($this->once())
->method('access')
->willReturn(FALSE);