function ProxyBuilderTest::testBuildReturnReference

@legacy-covers ::buildMethod @legacy-covers ::buildMethodBody

File

core/tests/Drupal/Tests/Component/ProxyBuilder/ProxyBuilderTest.php, line 175

Class

ProxyBuilderTest
Tests Drupal\Component\ProxyBuilder\ProxyBuilder.

Namespace

Drupal\Tests\Component\ProxyBuilder

Code

public function testBuildReturnReference() : void {
  $class = 'Drupal\\Tests\\Component\\ProxyBuilder\\TestServiceReturnReference';
  $result = $this->proxyBuilder
    ->build($class);
  // @todo Solve the silly linebreak for an empty array.
  $method_body = <<<'EOS'
  
  /**
   * {@inheritdoc}
   */
  public function &returnReference()
  {
      return $this->lazyLoadItself()->returnReference();
  }
  
  EOS;
  $this->assertEquals($this->buildExpectedClass($class, $method_body), $result);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.