Class ilChatroomServerSettingsTest.
More...
◆ setterAndGettersProvider()
ilChatroomServerSettingsTest::setterAndGettersProvider |
( |
| ) |
|
Definition at line 36 of file class.ilChatroomServerSettingsTest.php.
References array.
39 array(
'port',
'integer', 7373),
40 array(
'protocol',
'string',
'http://'),
41 array(
'domain',
'string',
'127.0.0.1'),
43 array(
'authKey',
'string',
'cfdf79fc-4133-4f3b-882f-5162a87dc465'),
44 array(
'authSecret',
'string',
'f8072a49-0488-411f-be0a-723a762700ba'),
45 array(
'clientUrlEnabled',
'boolean',
true),
46 array(
'clientUrl',
'string',
'http://proxy.localhost'),
47 array(
'iliasUrlEnabled',
'boolean',
true),
48 array(
'iliasUrl',
'string',
'http://proxy.localhost'),
49 array(
'smiliesEnabled',
'boolean',
false),
52 array(
'instance',
'string',
'123456'),
Create styles array
The data for the language used.
◆ setUp()
ilChatroomServerSettingsTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 14 of file class.ilChatroomServerSettingsTest.php.
References defined, and settings().
16 if(
defined(
'ILIAS_PHPUNIT_CONTEXT'))
18 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
19 ilUnitUtil::performInitialisation();
23 chdir(dirname(__FILE__));
27 require_once
'./Modules/Chatroom/classes/class.ilChatroomServerSettings.php';
Class ilChatroomServerSettings.
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
◆ testConstructor()
ilChatroomServerSettingsTest::testConstructor |
( |
| ) |
|
◆ testGenerateClientUrlIfDisabled()
ilChatroomServerSettingsTest::testGenerateClientUrlIfDisabled |
( |
| ) |
|
Definition at line 120 of file class.ilChatroomServerSettingsTest.php.
References settings().
122 $protocol =
'http://';
123 $domain =
'127.0.0.1';
124 $clientDomain =
'proxy.localhost';
126 $expected = sprintf(
'%s%s:%s', $protocol, $domain, $port);
128 $this->
settings->setClientUrlEnabled(
false);
129 $this->
settings->setDomain($domain);
131 $this->
settings->setProtocol($protocol);
132 $this->
settings->setClientUrl(sprintf(
'%s:%s', $clientDomain, $port));
134 $this->assertEquals($expected, $this->
settings->generateClientUrl());
◆ testGenerateClientUrlIfEnabled()
ilChatroomServerSettingsTest::testGenerateClientUrlIfEnabled |
( |
| ) |
|
Definition at line 103 of file class.ilChatroomServerSettingsTest.php.
References settings().
105 $protocol =
'http://';
106 $domain =
'127.0.0.1';
107 $clientDomain =
'proxy.localhost';
109 $expected = sprintf(
'%s%s:%s', $protocol, $clientDomain, $port);
111 $this->
settings->setClientUrlEnabled(
true);
112 $this->
settings->setProtocol($protocol);
113 $this->
settings->setDomain($domain);
115 $this->
settings->setClientUrl(sprintf(
'%s:%s', $clientDomain, $port));
117 $this->assertEquals($expected, $this->
settings->generateClientUrl());
◆ testGenerateIliasUrlIfDisabled()
ilChatroomServerSettingsTest::testGenerateIliasUrlIfDisabled |
( |
| ) |
|
Definition at line 154 of file class.ilChatroomServerSettingsTest.php.
References settings().
156 $protocol =
'http://';
157 $domain =
'127.0.0.1';
158 $iliasDomain =
'proxy.localhost';
160 $expected = sprintf(
'%s%s:%s', $protocol, $domain, $port);
162 $this->
settings->setIliasUrlEnabled(
false);
163 $this->
settings->setDomain($domain);
165 $this->
settings->setProtocol($protocol);
166 $this->
settings->setIliasUrl(sprintf(
'%s:%s', $iliasDomain, $port));
168 $this->assertEquals($expected, $this->
settings->generateIliasUrl());
◆ testGenerateIliasUrlIfEnabled()
ilChatroomServerSettingsTest::testGenerateIliasUrlIfEnabled |
( |
| ) |
|
Definition at line 137 of file class.ilChatroomServerSettingsTest.php.
References settings().
139 $protocol =
'http://';
140 $domain =
'127.0.0.1';
141 $iliasDomain =
'proxy.localhost';
143 $expected = sprintf(
'%s%s:%s', $protocol, $iliasDomain, $port);
145 $this->
settings->setIliasUrlEnabled(
true);
146 $this->
settings->setProtocol($protocol);
147 $this->
settings->setDomain($domain);
149 $this->
settings->setIliasUrl(sprintf(
'%s:%s', $iliasDomain, $port));
151 $this->assertEquals($expected, $this->
settings->generateIliasUrl());
◆ testGetBaseUrl()
ilChatroomServerSettingsTest::testGetBaseUrl |
( |
| ) |
|
◆ testGetUrl()
ilChatroomServerSettingsTest::testGetUrl |
( |
| ) |
|
Definition at line 171 of file class.ilChatroomServerSettingsTest.php.
References ilChatroomServerSettings\PREFIX, and settings().
173 $protocol =
'http://';
174 $domain =
'127.0.0.1';
175 $iliasDomain =
'proxy.localhost:8080';
177 $action =
'Heartbeat';
178 $instance =
'master';
181 $this->
settings->setProtocol($protocol .
'');
182 $this->
settings->setDomain($domain);
184 $this->
settings->setIliasUrl($iliasDomain);
185 $this->
settings->setInstance($instance);
187 $this->
settings->setIliasUrlEnabled(
false);
197 $this->assertEquals($expected, $this->
settings->getURL($action));
199 $this->
settings->setIliasUrlEnabled(
false);
201 '%s%s:%s%s/%s/%s/%s',
210 $this->assertEquals($expected, $this->
settings->getURL($action, $scope));
212 $this->
settings->setIliasUrlEnabled(
true);
221 $this->assertEquals($expected, $this->
settings->getURL($action));
223 $this->
settings->setIliasUrlEnabled(
true);
233 $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 62 of file class.ilChatroomServerSettingsTest.php.
References settings().
64 $setter =
'set' . ucfirst($property);
65 $getter =
'get' . ucfirst(($property));
67 $this->assertTrue(method_exists($this->
settings, $setter), sprintf(
'The Setter "%s" does not exist', $setter));
68 $this->assertTrue(method_exists($this->
settings, $getter), sprintf(
'The Getter "%s" does not exist', $setter));
71 $actual = $this->
settings->$getter();
73 $this->assertEquals($value, $actual, sprintf(
'The expected value "%s" is not equals to "%s"', $value, $actual));
75 if(class_exists($type))
77 $this->assertInstanceOf(
80 sprintf(
'The actual return value is not an instance of "%s"', $type)
85 $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: