Example #1
0
    /**
     * @covers ::buildMethod
     * @covers ::buildParameter
     * @covers ::buildMethodBody
     */
    public function testBuildComplexMethod()
    {
        $class = 'Drupal\\Tests\\Core\\ProxyBuilder\\TestServiceComplexMethod';
        $result = $this->proxyBuilder->build($class);
        // @todo Solve the silly linebreak for array()
        $method_body = <<<'EOS'

    public function complexMethod($parameter, callable $function, \Drupal\Tests\Core\ProxyBuilder\TestServiceNoMethod $test_service = NULL, array &$elements = array (
    ))
    {
        return $this->lazyLoadItself()->complexMethod($parameter, $function, $test_service, $elements);
    }

EOS;
        $this->assertEquals($this->buildExpectedClass($class, $method_body), $result);
    }