19 declare(strict_types=1);
53 ->getMockBuilder(ilMathJaxFactory::class)
54 ->disableOriginalConstructor()
55 ->onlyMethods([
'template',
'image',
'server'])
58 $factory->method(
'server')->willReturn($this->
getServerMock());
59 if (isset($imagefile)) {
60 $factory->method(
'image')->willReturn($this->
getImageMock($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');
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.
Rendered MathJax image Supports image types SVG or PNG Files are stored in the web file system of ili...
special template class to simplify handling of ITX/PEAR
Factory for objects used by ilMathJax.
getEmptyConfig()
Get a config without active settings.
Global Mathjax configuration.
getServerMock()
Get a mockup of the class for server calls.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Class for calling theMathJax server The server calls use cURL, if the extension is loaded...