ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 
12 {
13 
18 
22  protected $messageString = "This is a message";
23 
24  public function testConstructor()
25  {
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  {
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  {
50  $this->assertTrue($this->ilSystemStyleMessage->getTypeId() === ilSystemStyleMessage::TYPE_SUCCESS);
51 
53  $this->assertTrue($this->ilSystemStyleMessage->getTypeId() === ilSystemStyleMessage::TYPE_ERROR);
54 
56  $this->assertTrue($this->ilSystemStyleMessage->getTypeId() === ilSystemStyleMessage::TYPE_INFO);
57  }
58 
59  public function testGetMessageOutput()
60  {
62  $this->assertTrue($this->ilSystemStyleMessage->getMessageOutput() === "This is a message</br>");
63  }
64 }