Piwik\Plugins\API\Renderer\Xml::renderException PHP Метод

renderException() публичный Метод

public renderException ( $message, Exception | Throwable $exception ) : string
$message
$exception Exception | Throwable
Результат string
    public function renderException($message, $exception)
    {
        return '<?xml version="1.0" encoding="utf-8" ?>' . "\n" . "<result>\n" . "\t<error message=\"" . $message . "\" />\n" . "</result>";
    }

Usage Example

Пример #1
0
    public function test_renderException_shouldIncludeTheMessageAndNotExceptionMessage()
    {
        $response = $this->builder->renderException("The error message", new \Exception('The other message'));
        $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
<result>
	<error message="The error message" />
</result>', $response);
    }