public function ProxyBuilderTest::testBuildWithInterface in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Component/ProxyBuilder/ProxyBuilderTest.php \Drupal\Tests\Component\ProxyBuilder\ProxyBuilderTest::testBuildWithInterface()
- 9 core/tests/Drupal/Tests/Component/ProxyBuilder/ProxyBuilderTest.php \Drupal\Tests\Component\ProxyBuilder\ProxyBuilderTest::testBuildWithInterface()
@covers ::buildMethod @covers ::buildParameter @covers ::buildMethodBody
File
- core/
tests/ Drupal/ Tests/ Component/ ProxyBuilder/ ProxyBuilderTest.php, line 201 - Contains \Drupal\Tests\Component\ProxyBuilder\ProxyBuilderTest.
Class
- ProxyBuilderTest
- @coversDefaultClass \Drupal\Component\ProxyBuilder\ProxyBuilder @group proxy_builder
Namespace
Drupal\Tests\Component\ProxyBuilderCode
public function testBuildWithInterface() {
$class = 'Drupal\\Tests\\Component\\ProxyBuilder\\TestServiceWithInterface';
$result = $this->proxyBuilder
->build($class);
$method_body = <<<'EOS'
/**
* {@inheritdoc}
*/
public function testMethod($parameter)
{
return $this->lazyLoadItself()->testMethod($parameter);
}
EOS;
$interface_string = ' implements \\Drupal\\Tests\\Component\\ProxyBuilder\\TestInterface';
$this
->assertEquals($this
->buildExpectedClass($class, $method_body, $interface_string), $result);
}