コード例 #1
0
 /**
  * Should be able to get the view href for a viewable object.
  */
 public function testViewHrefFor()
 {
     /** @var Viewable|MockObject $viewable */
     $viewable = $this->makeMock(Viewable::class);
     $viewable->expects($this->atLeastOnce())->method('routePrefix');
     $viewable->expects($this->atLeastOnce())->method('locationParts');
     $this->urlGenerator->expects($this->atLeastOnce())->method('route')->willReturn($this->generator()->anySlug());
     $viewHref = $this->locationComposer->viewHrefFor($viewable);
     $this->assertInternalType('string', $viewHref);
 }