Unit tests for class ilObjSearchRpcClientCoordinator.
More...
◆ testRefreshLuceneSettings()
ilObjSearchRpcClientCoordinatorTest::testRefreshLuceneSettings |
( |
| ) |
|
Definition at line 29 of file ilObjSearchRpcClientCoordinatorTest.php.
References ILIAS\LTI\ToolProvider\$settings.
31 $src_logger = $this->getMockBuilder(ilLogger::class)
32 ->disableOriginalConstructor()
33 ->onlyMethods([
'error'])
35 $src_logger->expects($this->never())
38 $settings = $this->getMockBuilder(ilSetting::class)
39 ->disableOriginalConstructor()
40 ->onlyMethods([
'get'])
44 ->with(
'inst_id',
'0')
47 $rpc_client = $this->getMockBuilder(ilRpcClient::class)
48 ->disableOriginalConstructor()
49 ->addMethods([
'refreshSettings'])
51 $rpc_client->expects($this->once())
52 ->method(
'refreshSettings')
55 $coord = $this->getMockBuilder(ilObjSearchRpcClientCoordinator::class)
56 ->setConstructorArgs([
$settings, $src_logger])
57 ->onlyMethods([
'getRpcClient',
'getClientId'])
59 $coord->expects($this->once())
60 ->method(
'getClientId')
62 $coord->expects($this->once())
63 ->method(
'getRpcClient')
64 ->willReturn($rpc_client);
66 $this->assertSame(
true, $coord->refreshLuceneSettings());
◆ testRefreshLuceneSettingsException()
ilObjSearchRpcClientCoordinatorTest::testRefreshLuceneSettingsException |
( |
| ) |
|
Definition at line 69 of file ilObjSearchRpcClientCoordinatorTest.php.
References ILIAS\LTI\ToolProvider\$settings.
71 $src_logger = $this->getMockBuilder(ilLogger::class)
72 ->disableOriginalConstructor()
73 ->onlyMethods([
'error'])
75 $src_logger->expects($this->once())
78 'Refresh of lucene server settings ' .
79 'failed with message: message' 82 $settings = $this->getMockBuilder(ilSetting::class)
83 ->disableOriginalConstructor()
84 ->onlyMethods([
'get'])
88 ->with(
'inst_id',
'0')
91 $rpc_client = $this->getMockBuilder(ilRpcClient::class)
92 ->disableOriginalConstructor()
93 ->addMethods([
'refreshSettings'])
95 $rpc_client->expects($this->once())
96 ->method(
'refreshSettings')
98 ->willThrowException(
new Exception(
'message'));
100 $coord = $this->getMockBuilder(ilObjSearchRpcClientCoordinator::class)
101 ->setConstructorArgs([
$settings, $src_logger])
102 ->onlyMethods([
'getRpcClient',
'getClientId'])
104 $coord->expects($this->once())
105 ->method(
'getClientId')
107 $coord->expects($this->once())
108 ->method(
'getRpcClient')
109 ->willReturn($rpc_client);
111 $this->expectException(Exception::class);
112 $coord->refreshLuceneSettings();
The documentation for this class was generated from the following file: