function LinkTest::mockUrlAssembler
Same name in other branches
- 9 core/modules/jsonapi/tests/src/Unit/JsonApiResource/LinkTest.php \Drupal\Tests\jsonapi\Unit\JsonApiResource\LinkTest::mockUrlAssembler()
- 8.9.x core/modules/jsonapi/tests/src/Unit/JsonApiResource/LinkTest.php \Drupal\Tests\jsonapi\Unit\JsonApiResource\LinkTest::mockUrlAssembler()
- 10 core/modules/jsonapi/tests/src/Unit/JsonApiResource/LinkTest.php \Drupal\Tests\jsonapi\Unit\JsonApiResource\LinkTest::mockUrlAssembler()
Mocks the unrouted URL assembler.
3 calls to LinkTest::mockUrlAssembler()
- LinkTest::testGetLinkRelationType in core/
modules/ jsonapi/ tests/ src/ Unit/ JsonApiResource/ LinkTest.php - @covers ::getLinkRelationType
- LinkTest::testLinkComparison in core/
modules/ jsonapi/ tests/ src/ Unit/ JsonApiResource/ LinkTest.php - @covers ::compare @dataProvider linkComparisonProvider
- LinkTest::testLinkMerge in core/
modules/ jsonapi/ tests/ src/ Unit/ JsonApiResource/ LinkTest.php - @covers ::merge @dataProvider linkMergeProvider
File
-
core/
modules/ jsonapi/ tests/ src/ Unit/ JsonApiResource/ LinkTest.php, line 134
Class
- LinkTest
- @coversDefaultClass \Drupal\jsonapi\JsonApiResource\Link @group jsonapi
Namespace
Drupal\Tests\jsonapi\Unit\JsonApiResourceCode
protected function mockUrlAssembler() : void {
$url_assembler = $this->getMockBuilder(UnroutedUrlAssemblerInterface::class)
->disableOriginalConstructor()
->getMock();
$url_assembler->method('assemble')
->willReturnCallback(function ($uri) {
return (new GeneratedUrl())->setGeneratedUrl($uri);
});
$container = new ContainerBuilder();
$container->set('unrouted_url_assembler', $url_assembler);
\Drupal::setContainer($container);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.