Verified Commit 396dc994 authored by Lee Rowlands's avatar Lee Rowlands
Browse files

Issue #3394137 by smustgrave, acbramley: EntityListBuilder should return URL object vs mock

(cherry picked from commit c40438c1)
parent 457fb8bc
Loading
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityListBuilder;
use Drupal\Core\Routing\RedirectDestinationInterface;
use Drupal\Core\Url;
use Drupal\entity_test\EntityTestListBuilder;
use Drupal\Tests\UnitTestCase;

@@ -120,12 +121,7 @@ public function testGetOperations() {
    $this->role->expects($this->any())
      ->method('hasLinkTemplate')
      ->willReturn(TRUE);
    $url = $this->getMockBuilder('\Drupal\Core\Url')
      ->disableOriginalConstructor()
      ->getMock();
    $url->expects($this->atLeastOnce())
      ->method('mergeOptions')
      ->with(['query' => ['destination' => '/foo/bar']]);
    $url = Url::fromRoute('entity.user_role.collection');
    $this->role->expects($this->any())
      ->method('toUrl')
      ->willReturn($url);