ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilSystemStyleLessVariableTest.php
Go to the documentation of this file.
1 <?php
2 
3 include_once("./Services/Style/System/classes/Less/class.ilSystemStyleLessVariable.php");
4 
11 
12  public function testConstruct() {
13  $variable = new ilSystemStyleLessVariable("name", "value", "comment","category_name", ["references_id"]);
14  $this->assertEquals("name", $variable->getName());
15  $this->assertEquals("value", $variable->getValue());
16  $this->assertEquals("comment", $variable->getComment());
17  $this->assertEquals("category_name", $variable->getCategoryName());
18  $this->assertEquals(["references_id"], $variable->getReferences());
19  }
20 
21  public function testSetters() {
22  $variable = new ilSystemStyleLessVariable("name", "value", "comment","category_name", ["references_id"]);
23 
24  $variable->setName("newName");
25  $variable->setValue("newValue");
26  $variable->setComment("newComment");
27  $variable->setCategoryName("new_category_name");
28  $variable->setReferences(["new_references_id"]);
29 
30  $this->assertEquals("newName", $variable->getName());
31  $this->assertEquals("newValue", $variable->getValue());
32  $this->assertEquals("newComment", $variable->getComment());
33  $this->assertEquals("new_category_name", $variable->getCategoryName());
34  $this->assertEquals(["new_references_id"], $variable->getReferences());
35  }
36 
37  public function testNastyHack() {
38  $variable = new ilSystemStyleLessVariable("name", "value", "comment","category_name", ["references_id"]);
39 
40  $variable->setValue("\"../../Services/UICore/lib/bootstrap-3.2.0/fonts/\"");
41  $this->assertEquals("\"../../../../Services/UICore/lib/bootstrap-3.2.0/fonts/\"", $variable->getValue());
42  }
43 
44  public function testToString(){
45  $variable = new ilSystemStyleLessVariable("name", "value", "comment","category_name", ["references_id"]);
46  $this->assertEquals("//** comment\n@name:\t\tvalue;\n",(string)$variable);
47  }
48 
49 }