You are here

protected function NgLightboxTest::getUrlMock in NG Lightbox 8

Same name and namespace in other branches
  1. 2.x tests/src/Unit/NgLightboxTest.php \Drupal\Tests\ng_lightbox\Unit\NgLightboxTest::getUrlMock()

Helper to create Url mocks.

Parameters

bool|FALSE $is_external: TRUE if this URL is external otherwise FALSE.

Return value

\Prophecy\Prophecy\ObjectProphecy The url prophecy for testing.

1 call to NgLightboxTest::getUrlMock()
NgLightboxTest::testEmptyPath in tests/src/Unit/NgLightboxTest.php
Test with an empty path.

File

tests/src/Unit/NgLightboxTest.php, line 56
Contains \Drupal\Tests\ng_lightbox\Unit\NgLightboxTest

Class

NgLightboxTest
@coversDefaultClass \Drupal\ng_lightbox\NgLightbox @group ng_lightbox

Namespace

Drupal\Tests\ng_lightbox\Unit

Code

protected function getUrlMock($is_external = FALSE) {
  $url = $this
    ->prophesize('Drupal\\Core\\Url');
  $url
    ->isExternal()
    ->willReturn($is_external);
  return $url;
}