18 require_once
'./Services/Utilities/classes/class.ilBitmask.php';
29 $definition = array(
'1bit',
'2bit',
'4bit',
'8bit',
'16bit',
'32bit',
'64bit',
'128bit');
31 $settings =
new ilBitmask($definition, $bitmask);
42 $definition = array(
'1bit',
'2bit',
'4bit',
'8bit',
'16bit',
'32bit',
'64bit',
'128bit');
44 $settings =
new ilBitmask($definition, $bitmask);
47 $settings->set(
'1bit',
true);
48 $settings->set(
'2bit',
false);
49 $settings->set(
'4bit',
true);
50 $settings->set(
'8bit',
false);
51 $settings->set(
'16bit',
true);
52 $settings->set(
'32bit',
false);
53 $settings->set(
'64bit',
true);
54 $settings->set(
'128bit',
false);
57 $this->assertTrue($settings->get(
'1bit'));
58 $this->assertFalse($settings->get(
'2bit'));
59 $this->assertTrue($settings->get(
'4bit'));
60 $this->assertFalse($settings->get(
'8bit'));
61 $this->assertTrue($settings->get(
'16bit'));
62 $this->assertFalse($settings->get(
'32bit'));
63 $this->assertTrue($settings->get(
'64bit'));
64 $this->assertFalse($settings->get(
'128bit'));
70 $definition = array(
'1bit',
'2bit',
'4bit',
'8bit',
'16bit',
'32bit',
'64bit',
'128bit');
72 $settings =
new ilBitmask($definition, $bitmask);
75 $settings->set(
'1bit',
true);
76 $settings->set(
'2bit',
true);
77 $settings->set(
'4bit',
true);
78 $settings->set(
'8bit',
true);
79 $settings->set(
'16bit',
true);
80 $settings->set(
'32bit',
true);
81 $settings->set(
'64bit',
true);
82 $settings->set(
'128bit',
true);
85 $this->assertTrue($settings->get(
'1bit'));
86 $this->assertTrue($settings->get(
'2bit'));
87 $this->assertTrue($settings->get(
'4bit'));
88 $this->assertTrue($settings->get(
'8bit'));
89 $this->assertTrue($settings->get(
'16bit'));
90 $this->assertTrue($settings->get(
'32bit'));
91 $this->assertTrue($settings->get(
'64bit'));
92 $this->assertTrue($settings->get(
'128bit'));
98 $definition = array(
'1bit',
'2bit',
'4bit',
'8bit',
'16bit',
'32bit',
'64bit',
'128bit');
100 $settings =
new ilBitmask($definition, $bitmask);
103 $settings->set(
'1bit',
false);
104 $settings->set(
'2bit',
false);
105 $settings->set(
'4bit',
false);
106 $settings->set(
'8bit',
false);
107 $settings->set(
'16bit',
false);
108 $settings->set(
'32bit',
false);
109 $settings->set(
'64bit',
false);
110 $settings->set(
'128bit',
false);
113 $this->assertFalse($settings->get(
'1bit'));
114 $this->assertFalse($settings->get(
'2bit'));
115 $this->assertFalse($settings->get(
'4bit'));
116 $this->assertFalse($settings->get(
'8bit'));
117 $this->assertFalse($settings->get(
'16bit'));
118 $this->assertFalse($settings->get(
'32bit'));
119 $this->assertFalse($settings->get(
'64bit'));
120 $this->assertFalse($settings->get(
'128bit'));
126 $definition = array(
'1bit',
'2bit',
'4bit',
'8bit',
'16bit',
'32bit',
'64bit',
'128bit');
128 $settings =
new ilBitmask($definition, $bitmask);
131 $settings->set(
'1bit',
false);
132 $settings->set(
'2bit',
true);
133 $settings->set(
'4bit',
false);
134 $settings->set(
'8bit',
true);
135 $settings->set(
'16bit',
false);
136 $settings->set(
'32bit',
true);
137 $settings->set(
'64bit',
false);
138 $settings->set(
'128bit',
true);
141 $settings->set(
'1bit',
true);
142 $settings->set(
'2bit',
false);
143 $settings->set(
'4bit',
true);
144 $settings->set(
'8bit',
false);
145 $settings->set(
'16bit',
true);
146 $settings->set(
'32bit',
false);
147 $settings->set(
'64bit',
true);
148 $settings->set(
'128bit',
false);
151 $this->assertTrue($settings->get(
'1bit'));
152 $this->assertFalse($settings->get(
'2bit'));
153 $this->assertTrue($settings->get(
'4bit'));
154 $this->assertFalse($settings->get(
'8bit'));
155 $this->assertTrue($settings->get(
'16bit'));
156 $this->assertFalse($settings->get(
'32bit'));
157 $this->assertTrue($settings->get(
'64bit'));
158 $this->assertFalse($settings->get(
'128bit'));
167 $definition = array(
'1bit',
'2bit',
'4bit',
'8bit',
'16bit',
'32bit',
'64bit',
'128bit');
169 $settings =
new ilBitmask($definition, $bitmask);
172 $settings->set(
'Günther',
true);
181 $definition = array(
'1bit',
'2bit',
'4bit',
'8bit',
'16bit',
'32bit',
'64bit',
'128bit');
183 $settings =
new ilBitmask($definition, $bitmask);
186 $settings->get(
'Günther');
192 $definition = array(
'1bit',
'2bit',
'4bit',
'8bit',
'16bit',
'32bit',
'64bit',
'128bit');
194 $settings =
new ilBitmask($definition, $bitmask);
197 $settings->set(
'1bit',
true);
198 $settings->set(
'2bit',
false);
199 $settings->set(
'4bit',
true);
200 $settings->set(
'8bit',
false);
201 $settings->set(
'16bit',
true);
202 $settings->set(
'32bit',
false);
203 $settings->set(
'64bit',
true);
204 $settings->set(
'128bit',
false);
208 $this->assertEquals( $expected, $settings->getBitmask() );