Files
FOSSBilling/tests/includes/FakeTemplateWrapper.php
T
Belle Aerni 32d011225b Rector & PHP-CS-Fixer Improvements (#2047)
* Added the rector cache to the action

* Enabled PHP-CS fixer for the tests & library folder

* Use the PHP-CS-Fixer Cache

* Fix the tests

* Ensure the Sentry placeholder isn't messed up from CS changes

* Typo..
2024-01-08 00:10:00 +00:00

39 lines
952 B
PHP

<?php
/**
* Defines a fake template class to mock \Twig_TemplateWrapper.
*
* We cannot use getMockBuilder() for this, because the Twig TemplateWrapper
* class is declared "final" and cannot be mocked.
*
* https://github.rpi.edu/DotCIOweb/test-pantheon-starterkit/blob/107b23d9f231c392e2cd9b4f677f4c1a30e508fa/core/modules/help_topics/tests/src/Unit/HelpTopicTwigTest.php
*/
/**
* @deprecated since Twig 3: Will be remove or maybe could be find best way
*/
class FakeTemplateWrapper
{
/**
* Constructor.
*
* @param string $body
* Body text to return from the render() method
*/
public function __construct(
/**
* Body text to return from the render() method.
*/
protected $body
) {
}
/**
* Mocks the \Twig_TemplateWrapper render() method.
*/
public function render(array $context = [])
{
return $this->body;
}
}