ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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 
7 
14 {
15 
20 
24  protected $messageString = "This is a message";
25 
26  public function testConstructor()
27  {
29  $this->assertTrue($this->ilSystemStyleMessage->getTypeId() === ilSystemStyleMessage::TYPE_INFO);
30  $this->assertTrue($this->ilSystemStyleMessage->getMessage() === $this->messageString);
31 
32  $this->ilSystemStyleMessage = new ilSystemStyleMessage($this->messageString, ilSystemStyleMessage::TYPE_SUCCESS);
33  $this->assertTrue($this->ilSystemStyleMessage->getTypeId() === ilSystemStyleMessage::TYPE_SUCCESS);
34  $this->assertTrue($this->ilSystemStyleMessage->getMessage() === $this->messageString);
35 
36  $this->ilSystemStyleMessage = new ilSystemStyleMessage($this->messageString, ilSystemStyleMessage::TYPE_ERROR);
37  $this->assertTrue($this->ilSystemStyleMessage->getTypeId() === ilSystemStyleMessage::TYPE_ERROR);
38  $this->assertTrue($this->ilSystemStyleMessage->getMessage() === $this->messageString);
39  }
40 
41  public function testGetAndSetMessage()
42  {
44  $this->ilSystemStyleMessage->setMessage("This is an altered message");
45  $this->assertTrue($this->ilSystemStyleMessage->getMessage() === "This is an altered message");
46  }
47 
48  public function testGetAndSetTypeID()
49  {
52  $this->assertTrue($this->ilSystemStyleMessage->getTypeId() === ilSystemStyleMessage::TYPE_SUCCESS);
53 
55  $this->assertTrue($this->ilSystemStyleMessage->getTypeId() === ilSystemStyleMessage::TYPE_ERROR);
56 
58  $this->assertTrue($this->ilSystemStyleMessage->getTypeId() === ilSystemStyleMessage::TYPE_INFO);
59  }
60 
61  public function testGetMessageOutput()
62  {
64  $this->assertTrue($this->ilSystemStyleMessage->getMessageOutput() === "This is a message</br>");
65  }
66 }