Class ilChatroomServerSettingsTest.
More...
◆ setterAndGettersProvider()
ilChatroomServerSettingsTest::setterAndGettersProvider |
( |
| ) |
|
Definition at line 33 of file class.ilChatroomServerSettingsTest.php.
36 array(
'port',
'integer', 7373),
37 array(
'protocol',
'string',
'http://'),
38 array(
'domain',
'string',
'127.0.0.1'),
40 array(
'authKey',
'string',
'cfdf79fc-4133-4f3b-882f-5162a87dc465'),
41 array(
'authSecret',
'string',
'f8072a49-0488-411f-be0a-723a762700ba'),
42 array(
'clientUrlEnabled',
'boolean',
true),
43 array(
'clientUrl',
'string',
'http://proxy.localhost'),
44 array(
'iliasUrlEnabled',
'boolean',
true),
45 array(
'iliasUrl',
'string',
'http://proxy.localhost'),
46 array(
'smiliesEnabled',
'boolean',
false),
49 array(
'instance',
'string',
'123456'),
◆ setUp()
ilChatroomServerSettingsTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 14 of file class.ilChatroomServerSettingsTest.php.
References settings().
16 if (defined(
'ILIAS_PHPUNIT_CONTEXT')) {
17 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
18 ilUnitUtil::performInitialisation();
20 chdir(dirname(__FILE__));
24 require_once
'./Modules/Chatroom/classes/class.ilChatroomServerSettings.php';
Class ilChatroomServerSettings.
◆ testConstructor()
ilChatroomServerSettingsTest::testConstructor |
( |
| ) |
|
◆ testGenerateClientUrlIfDisabled()
ilChatroomServerSettingsTest::testGenerateClientUrlIfDisabled |
( |
| ) |
|
Definition at line 114 of file class.ilChatroomServerSettingsTest.php.
References settings().
116 $protocol =
'http://';
117 $domain =
'127.0.0.1';
118 $clientDomain =
'proxy.localhost';
120 $expected = sprintf(
'%s%s:%s', $protocol, $domain, $port);
122 $this->
settings->setClientUrlEnabled(
false);
123 $this->
settings->setDomain($domain);
125 $this->
settings->setProtocol($protocol);
126 $this->
settings->setClientUrl(sprintf(
'%s:%s', $clientDomain, $port));
128 $this->assertEquals($expected, $this->
settings->generateClientUrl());
◆ testGenerateClientUrlIfEnabled()
ilChatroomServerSettingsTest::testGenerateClientUrlIfEnabled |
( |
| ) |
|
Definition at line 97 of file class.ilChatroomServerSettingsTest.php.
References settings().
99 $protocol =
'http://';
100 $domain =
'127.0.0.1';
101 $clientDomain =
'proxy.localhost';
103 $expected = sprintf(
'%s%s:%s', $protocol, $clientDomain, $port);
105 $this->
settings->setClientUrlEnabled(
true);
106 $this->
settings->setProtocol($protocol);
107 $this->
settings->setDomain($domain);
109 $this->
settings->setClientUrl(sprintf(
'%s:%s', $clientDomain, $port));
111 $this->assertEquals($expected, $this->
settings->generateClientUrl());
◆ testGenerateIliasUrlIfDisabled()
ilChatroomServerSettingsTest::testGenerateIliasUrlIfDisabled |
( |
| ) |
|
Definition at line 148 of file class.ilChatroomServerSettingsTest.php.
References settings().
150 $protocol =
'http://';
151 $domain =
'127.0.0.1';
152 $iliasDomain =
'proxy.localhost';
154 $expected = sprintf(
'%s%s:%s', $protocol, $domain, $port);
156 $this->
settings->setIliasUrlEnabled(
false);
157 $this->
settings->setDomain($domain);
159 $this->
settings->setProtocol($protocol);
160 $this->
settings->setIliasUrl(sprintf(
'%s:%s', $iliasDomain, $port));
162 $this->assertEquals($expected, $this->
settings->generateIliasUrl());
◆ testGenerateIliasUrlIfEnabled()
ilChatroomServerSettingsTest::testGenerateIliasUrlIfEnabled |
( |
| ) |
|
Definition at line 131 of file class.ilChatroomServerSettingsTest.php.
References settings().
133 $protocol =
'http://';
134 $domain =
'127.0.0.1';
135 $iliasDomain =
'proxy.localhost';
137 $expected = sprintf(
'%s%s:%s', $protocol, $iliasDomain, $port);
139 $this->
settings->setIliasUrlEnabled(
true);
140 $this->
settings->setProtocol($protocol);
141 $this->
settings->setDomain($domain);
143 $this->
settings->setIliasUrl(sprintf(
'%s:%s', $iliasDomain, $port));
145 $this->assertEquals($expected, $this->
settings->generateIliasUrl());
◆ testGetBaseUrl()
ilChatroomServerSettingsTest::testGetBaseUrl |
( |
| ) |
|
◆ testGetUrl()
ilChatroomServerSettingsTest::testGetUrl |
( |
| ) |
|
Definition at line 165 of file class.ilChatroomServerSettingsTest.php.
References ilChatroomServerSettings\PREFIX, and settings().
167 $protocol =
'http://';
168 $domain =
'127.0.0.1';
169 $iliasDomain =
'proxy.localhost:8080';
171 $action =
'Heartbeat';
172 $instance =
'master';
175 $this->
settings->setProtocol($protocol .
'');
176 $this->
settings->setDomain($domain);
178 $this->
settings->setIliasUrl($iliasDomain);
179 $this->
settings->setInstance($instance);
181 $this->
settings->setIliasUrlEnabled(
false);
191 $this->assertEquals($expected, $this->
settings->getURL($action));
193 $this->
settings->setIliasUrlEnabled(
false);
195 '%s%s:%s%s/%s/%s/%s',
204 $this->assertEquals($expected, $this->
settings->getURL($action, $scope));
206 $this->
settings->setIliasUrlEnabled(
true);
215 $this->assertEquals($expected, $this->
settings->getURL($action));
217 $this->
settings->setIliasUrlEnabled(
true);
227 $this->assertEquals($expected, $this->
settings->getURL($action, $scope));
◆ testSettersAndGetters()
ilChatroomServerSettingsTest::testSettersAndGetters |
( |
|
$property, |
|
|
|
$type, |
|
|
|
$value |
|
) |
| |
- Parameters
-
string | $property | |
string | $type | |
mixed | $value | setterAndGettersProvider |
Definition at line 59 of file class.ilChatroomServerSettingsTest.php.
References $type, and settings().
61 $setter =
'set' . ucfirst($property);
62 $getter =
'get' . ucfirst(($property));
64 $this->assertTrue(method_exists($this->
settings, $setter), sprintf(
'The Setter "%s" does not exist', $setter));
65 $this->assertTrue(method_exists($this->
settings, $getter), sprintf(
'The Getter "%s" does not exist', $setter));
68 $actual = $this->
settings->$getter();
70 $this->assertEquals($value, $actual, sprintf(
'The expected value "%s" is not equals to "%s"', $value, $actual));
72 if (class_exists(
$type)) {
73 $this->assertInstanceOf(
76 sprintf(
'The actual return value is not an instance of "%s"',
$type)
79 $this->assertInternalType(
$type, $actual, sprintf(
'The actual return value is not a type of "%s"',
$type));
◆ $settings
ilChatroomServerSettingsTest::$settings |
|
protected |
The documentation for this class was generated from the following file: