ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilSystemStyleStyleScssFileTest Class Reference
+ Inheritance diagram for ilSystemStyleStyleScssFileTest:
+ Collaboration diagram for ilSystemStyleStyleScssFileTest:

Public Member Functions

 testConstructAndRead ()
 
 testReadCorrectTypes ()
 
 testGetCategory ()
 
 testGetItems ()
 
 testGetContent ()
 
 testAddAndWriteItems ()
 

Protected Member Functions

 setUp ()
 
- Protected Member Functions inherited from ilSystemStyleBaseFS
 setUp ()
 
 getAllContentOfFolder (string $directory)
 
 tearDown ()
 

Additional Inherited Members

- Protected Attributes inherited from ilSystemStyleBaseFS
ilSystemStyleConfigMock $system_style_config
 
ilSkinStyleContainer $container
 
ilSkinStyle $style
 
ilFileSystemHelper $file_system
 
ILIAS DI Container $save_dic = null
 
ilLanguage $lng
 
ilSystemStyleMessageStack $message_stack
 

Detailed Description

Definition at line 23 of file ilSystemStyleStyleScssFileTest.php.

Member Function Documentation

◆ setUp()

ilSystemStyleStyleScssFileTest::setUp ( )
protected

Definition at line 25 of file ilSystemStyleStyleScssFileTest.php.

References $path.

25  : void
26  {
27  parent::setUp();
28  $path = $this->container->getScssSettingsPath($this->style->getId());
29  $this->file = new ilSystemStyleScssSettingsFile($path, "variables1.scss");
30  }
$path
Definition: ltiservices.php:32

◆ testAddAndWriteItems()

ilSystemStyleStyleScssFileTest::testAddAndWriteItems ( )

Definition at line 133 of file ilSystemStyleStyleScssFileTest.php.

133  : void
134  {
135  $empty_path = $this->container->getSkinDirectory() . 'scss-test/empty-file/';
136  $file = new ilSystemStyleScssSettingsFile($empty_path, "empty.scss");
137 
138  $expected_category1 = new ilSystemStyleScssCategory('Category 1', 'Comment Category 1');
139  $expected_comment2 = new ilSystemStyleScssComment('// Random Section 1');
140  $expected_comment3 = new ilSystemStyleScssComment('');
141  $expected_variable11 = new ilSystemStyleScssVariable(
142  'variable11',
143  'value11',
144  'comment variable 11',
145  'Category 1',
146  []
147  );
148  $expected_variable12 = new ilSystemStyleScssVariable(
149  'variable12',
150  'value12',
151  'comment variable 12',
152  'Category 1',
153  []
154  );
155  $expected_variable13 = new ilSystemStyleScssVariable(
156  'variable13',
157  '$variable11',
158  'comment variable 13',
159  'Category 1',
160  ['variable11']
161  );
162  $expected_comment4 = new ilSystemStyleScssComment('');
163  $expected_category2 = new ilSystemStyleScssCategory('Category 2', 'Comment Category 2');
164  $expected_comment6 = new ilSystemStyleScssComment('');
166  $expected_comment8 = new ilSystemStyleScssComment('');
167  $expected_variable21 = new ilSystemStyleScssVariable(
168  'variable21',
169  '$variable11',
170  'comment variable 21',
171  'Category 2',
172  ['variable11']
173  );
174  $expected_variable22 = new ilSystemStyleScssVariable(
175  'variable22',
176  'value21',
177  'comment variable 22',
178  'Category 2',
179  []
180  );
181  $expected_variable23 = new ilSystemStyleScssVariable(
182  'variable23',
183  '$variable21',
184  'comment variable 23',
185  'Category 2',
186  ['variable21']
187  );
188 
189  $expected_items = [$expected_category1,
190  $expected_comment2,
191  $expected_comment3,
192  $expected_variable11,
193  $expected_variable12,
194  $expected_variable13,
195  $expected_comment4,
196  $expected_category2,
197  $expected_comment6,
198  $expected_comment7,
199  $expected_comment8,
200  $expected_variable21,
201  $expected_variable22,
202  $expected_variable23
203  ];
204 
205  foreach ($expected_items as $item) {
206  $file->addItem($item);
207  }
208  $file->write();
209 
210  $new_file = new ilSystemStyleScssSettingsFile($empty_path, "empty.scss");
211  $this->assertEquals($expected_items, $new_file->getItems());
212  }
Capsules data of a Scss category in the variables to Scss file.
Capsules all data which is neither part of a variable or category structure in the Scss file...

◆ testConstructAndRead()

ilSystemStyleStyleScssFileTest::testConstructAndRead ( )

Definition at line 32 of file ilSystemStyleStyleScssFileTest.php.

32  : void
33  {
34  $this->assertCount(14, $this->file->getItems());
35  }

◆ testGetCategory()

ilSystemStyleStyleScssFileTest::testGetCategory ( )

Definition at line 44 of file ilSystemStyleStyleScssFileTest.php.

44  : void
45  {
46  $expected_categories = [];
47 
48  $expected_categories['Category 11'] = new ilSystemStyleScssCategory('Category 11', 'Comment Category 11');
49  $expected_categories['Category 12'] = new ilSystemStyleScssCategory('Category 12', 'Comment Category 12');
50 
51  $this->assertEquals($expected_categories, $this->file->getCategories());
52  }
Capsules data of a Scss category in the variables to Scss file.

◆ testGetContent()

ilSystemStyleStyleScssFileTest::testGetContent ( )

Definition at line 127 of file ilSystemStyleStyleScssFileTest.php.

127  : void
128  {
129  $expected_content = file_get_contents($this->file->getScssVariablesSettingsPath()."/variables1.scss");
130  $this->assertEquals($expected_content, $this->file->getContent());
131  }

◆ testGetItems()

ilSystemStyleStyleScssFileTest::testGetItems ( )

Definition at line 54 of file ilSystemStyleStyleScssFileTest.php.

54  : void
55  {
56  $expected_category11 = new ilSystemStyleScssCategory('Category 11', 'Comment Category 11');
57  $expected_comment12 = new ilSystemStyleScssComment('// Random Section 11');
58  $expected_comment13 = new ilSystemStyleScssComment('');
59  $expected_variable111 = new ilSystemStyleScssVariable(
60  'variable111',
61  'value111',
62  'comment variable 111',
63  'Category 11',
64  []
65  );
66  $expected_variable112 = new ilSystemStyleScssVariable(
67  'variable112',
68  'value112',
69  'comment variable 112',
70  'Category 11',
71  []
72  );
73  $expected_variable113 = new ilSystemStyleScssVariable(
74  'variable113',
75  '$variable111',
76  'comment variable 113',
77  'Category 11',
78  ['variable111']
79  );
80  $expected_comment14 = new ilSystemStyleScssComment('');
81  $expected_category12 = new ilSystemStyleScssCategory('Category 12', 'Comment Category 12');
82  $expected_comment16 = new ilSystemStyleScssComment('');
84  $expected_comment18 = new ilSystemStyleScssComment('');
85  $expected_variable121 = new ilSystemStyleScssVariable(
86  'variable121',
87  '$variable111',
88  'comment variable 121',
89  'Category 12',
90  ['variable111']
91  );
92  $expected_variable122 = new ilSystemStyleScssVariable(
93  'variable122',
94  'value121',
95  'comment variable 122',
96  'Category 12',
97  []
98  );
99  $expected_variable123 = new ilSystemStyleScssVariable(
100  'variable123',
101  '$variable121',
102  'comment variable 123',
103  'Category 12',
104  ['variable121']
105  );
106 
107  $expected_items = [
108  $expected_category11,
109  $expected_comment12,
110  $expected_comment13,
111  $expected_variable111,
112  $expected_variable112,
113  $expected_variable113,
114  $expected_comment14,
115  $expected_category12,
116  $expected_comment16,
117  $expected_comment17,
118  $expected_comment18,
119  $expected_variable121,
120  $expected_variable122,
121  $expected_variable123,
122  ];
123 
124  $this->assertEquals($expected_items, $this->file->getItems());
125  }
Capsules data of a Scss category in the variables to Scss file.
Capsules all data which is neither part of a variable or category structure in the Scss file...

◆ testReadCorrectTypes()

ilSystemStyleStyleScssFileTest::testReadCorrectTypes ( )

Definition at line 37 of file ilSystemStyleStyleScssFileTest.php.

37  : void
38  {
39  $this->assertCount(2, $this->file->getCategories());
40  $this->assertCount(6, $this->file->getVariables());
41  $this->assertCount(14, $this->file->getItems());
42  }

The documentation for this class was generated from the following file: