ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
ilSystemStyleMessageTest.php
Go to the documentation of this file.
1
<?php
2
/* Copyright (c) 2016 Tomasz Kolonko <thomas.kolonko@ilub.unibe.ch> Extended GPL, see docs/LICENSE */
3
4
include_once(
"Services/Style/System/classes/Utilities/class.ilSystemStyleMessage.php"
);
5
11
class
ilSystemStyleMessageTest
extends
PHPUnit_Framework_TestCase
12
{
13
17
protected
$ilSystemStyleMessage
;
18
22
protected
$messageString
=
"This is a message"
;
23
24
public
function
testConstructor
()
25
{
26
$this->
ilSystemStyleMessage
=
new
ilSystemStyleMessage
($this->messageString,
ilSystemStyleMessage::TYPE_INFO
);
27
$this->assertTrue($this->
ilSystemStyleMessage
->
getTypeId
() ===
ilSystemStyleMessage::TYPE_INFO
);
28
$this->assertTrue($this->
ilSystemStyleMessage
->
getMessage
() ===
$this->messageString
);
29
30
$this->
ilSystemStyleMessage
=
new
ilSystemStyleMessage($this->messageString,
ilSystemStyleMessage::TYPE_SUCCESS
);
31
$this->assertTrue($this->ilSystemStyleMessage->getTypeId() ===
ilSystemStyleMessage::TYPE_SUCCESS
);
32
$this->assertTrue($this->ilSystemStyleMessage->getMessage() ===
$this->messageString
);
33
34
$this->ilSystemStyleMessage =
new
ilSystemStyleMessage($this->messageString,
ilSystemStyleMessage::TYPE_ERROR
);
35
$this->assertTrue($this->ilSystemStyleMessage->getTypeId() ===
ilSystemStyleMessage::TYPE_ERROR
);
36
$this->assertTrue($this->ilSystemStyleMessage->getMessage() ===
$this->messageString
);
37
}
38
39
public
function
testGetAndSetMessage
()
40
{
41
$this->
ilSystemStyleMessage
=
new
ilSystemStyleMessage
($this->messageString,
ilSystemStyleMessage::TYPE_INFO
);
42
$this->
ilSystemStyleMessage
->
setMessage
(
"This is an altered message"
);
43
$this->assertTrue($this->
ilSystemStyleMessage
->
getMessage
() ===
"This is an altered message"
);
44
}
45
46
public
function
testGetAndSetTypeID
()
47
{
48
$this->
ilSystemStyleMessage
=
new
ilSystemStyleMessage
($this->messageString,
ilSystemStyleMessage::TYPE_INFO
);
49
$this->
ilSystemStyleMessage
->
setTypeId
(
ilSystemStyleMessage::TYPE_SUCCESS
);
50
$this->assertTrue($this->
ilSystemStyleMessage
->
getTypeId
() ===
ilSystemStyleMessage::TYPE_SUCCESS
);
51
52
$this->
ilSystemStyleMessage
->
setTypeId
(
ilSystemStyleMessage::TYPE_ERROR
);
53
$this->assertTrue($this->
ilSystemStyleMessage
->
getTypeId
() ===
ilSystemStyleMessage::TYPE_ERROR
);
54
55
$this->
ilSystemStyleMessage
->
setTypeId
(
ilSystemStyleMessage::TYPE_INFO
);
56
$this->assertTrue($this->
ilSystemStyleMessage
->
getTypeId
() ===
ilSystemStyleMessage::TYPE_INFO
);
57
}
58
59
public
function
testGetMessageOutput
()
60
{
61
$this->
ilSystemStyleMessage
=
new
ilSystemStyleMessage
($this->messageString,
ilSystemStyleMessage::TYPE_INFO
);
62
$this->assertTrue($this->
ilSystemStyleMessage
->
getMessageOutput
() ===
"This is a message</br>"
);
63
}
64
}
ilSystemStyleMessageTest\testConstructor
testConstructor()
Definition:
ilSystemStyleMessageTest.php:24
ilSystemStyleMessageTest\testGetAndSetTypeID
testGetAndSetTypeID()
Definition:
ilSystemStyleMessageTest.php:46
ilSystemStyleMessage\getMessageOutput
getMessageOutput()
Definition:
class.ilSystemStyleMessage.php:39
PHPUnit_Framework_TestCase
ilSystemStyleMessageTest\$ilSystemStyleMessage
$ilSystemStyleMessage
Definition:
ilSystemStyleMessageTest.php:17
ilSystemStyleMessage
Message for the user.
Definition:
class.ilSystemStyleMessage.php:8
ilSystemStyleMessage\setMessage
setMessage($message)
Definition:
class.ilSystemStyleMessage.php:55
ilSystemStyleMessage\getTypeId
getTypeId()
Definition:
class.ilSystemStyleMessage.php:63
ilSystemStyleMessage\setTypeId
setTypeId($type_id)
Definition:
class.ilSystemStyleMessage.php:72
ilSystemStyleMessageTest\testGetAndSetMessage
testGetAndSetMessage()
Definition:
ilSystemStyleMessageTest.php:39
ilSystemStyleMessage\TYPE_ERROR
const TYPE_ERROR
Definition:
class.ilSystemStyleMessage.php:12
ilSystemStyleMessage\TYPE_INFO
const TYPE_INFO
Definition:
class.ilSystemStyleMessage.php:10
ilSystemStyleMessageTest\testGetMessageOutput
testGetMessageOutput()
Definition:
ilSystemStyleMessageTest.php:59
ilSystemStyleMessageTest
Definition:
ilSystemStyleMessageTest.php:11
ilSystemStyleMessage\getMessage
getMessage()
Definition:
class.ilSystemStyleMessage.php:47
ilSystemStyleMessage\TYPE_SUCCESS
const TYPE_SUCCESS
Definition:
class.ilSystemStyleMessage.php:11
ilSystemStyleMessageTest\$messageString
$messageString
Definition:
ilSystemStyleMessageTest.php:22
Services
Style
System
test
ilSystemStyleMessageTest.php
Generated on Sat Jan 18 2025 19:01:38 for ILIAS by
1.8.13 (using
Doxyfile
)