public function ProxyBuilderTest::testBuildServiceMethodReturnsVoid in Drupal 10
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Component/ProxyBuilder/ProxyBuilderTest.php \Drupal\Tests\Component\ProxyBuilder\ProxyBuilderTest::testBuildServiceMethodReturnsVoid()
@covers ::buildMethodBody
File
- core/
tests/ Drupal/ Tests/ Component/ ProxyBuilder/ ProxyBuilderTest.php, line 150 - Contains \Drupal\Tests\Component\ProxyBuilder\ProxyBuilderTest.
Class
- ProxyBuilderTest
- @coversDefaultClass \Drupal\Component\ProxyBuilder\ProxyBuilder @group proxy_builder
Namespace
Drupal\Tests\Component\ProxyBuilderCode
public function testBuildServiceMethodReturnsVoid() {
$class = TestServiceMethodReturnsVoid::class;
$result = $this->proxyBuilder
->build($class);
// @todo Solve the silly linebreak for array()
$method_body = <<<'EOS'
/**
* {@inheritdoc}
*/
public function methodReturnsVoid(string $parameter): void
{
$this->lazyLoadItself()->methodReturnsVoid($parameter);
}
EOS;
$this
->assertEquals($this
->buildExpectedClass($class, $method_body), $result);
}