19declare(strict_types=1);
21use PHPUnit\Framework\TestCase;
53 ->getMockBuilder(ilMathJaxFactory::class)
54 ->disableOriginalConstructor()
55 ->onlyMethods([
'template',
'image',
'server'])
59 if (isset($imagefile)) {
71 ->getMockBuilder(ilGlobalTemplate::class)
72 ->disableOriginalConstructor()
73 ->onlyMethods([
'addJavaScript'])
85 ->getMockBuilder(ilMathJaxImage::class)
86 ->disableOriginalConstructor()
87 ->onlyMethods([
'exists',
'read',
'write',
'absolutePath',
'getCacheSize'])
89 $image->method(
'exists')->willReturn(
false);
90 $image->method(
'read')->willReturn(file_get_contents(__DIR__ .
'/' . $imagefile));
91 $image->method(
'absolutePath')->willReturn(__DIR__ .
'/' . $imagefile);
92 $image->method(
'getCacheSize')->willReturn(
'10 KB');
102 ->getMockBuilder(ilMathJaxServer::class)
103 ->disableOriginalConstructor()
104 ->onlyMethods([
'call'])
106 $server->method(
'call')->willReturn(
'server call result');
special template class to simplify handling of ITX/PEAR
getTemplateMock()
Get a global template mockup.
getImageMock(string $imagefile)
Get a cached image mockup from an example file.
getFactoryMock(?string $imagefile=null)
Get a factory mockup that will deliver other mockups.
getEmptyConfig()
Get a config without active settings.
getServerMock()
Get a mockup of the class for server calls.
Global Mathjax configuration.
Factory for objects used by ilMathJax.
Rendered MathJax image Supports image types SVG or PNG Files are stored in the web file system of ili...
Class for calling theMathJax server The server calls use cURL, if the extension is loaded,...