ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ValueTest Class Reference

Class BackgroundTaskTest. More...

+ Inheritance diagram for ValueTest:
+ Collaboration diagram for ValueTest:

Public Member Functions

 testIntegerValue ()
 
 testListValue ()
 

Detailed Description

Class BackgroundTaskTest.

disabled disabled disabled

Author
Oskar Truffer ot@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 23 of file ValueTest.php.

Member Function Documentation

◆ testIntegerValue()

ValueTest::testIntegerValue ( )

Definition at line 25 of file ValueTest.php.

26  {
27  $integer = new IntegerValue();
28  $integer->setValue(3);
29  $integer2 = new IntegerValue(3);
30  $integer2->setValue(3);
31  $integer3 = new IntegerValue(4);
32  $integer3->setValue(4);
33 
34  $this->assertEquals($integer->getValue(), 3);
35  $this->assertTrue($integer->equals($integer2));
36  $this->assertEquals($integer->getHash(), $integer2->getHash());
37  $this->assertNotEquals($integer->getHash(), $integer3->getHash());
38  $integer3->unserialize($integer->serialize());
39  $this->assertTrue($integer->equals($integer3));
40  $this->assertTrue($integer->getType()->equals(new SingleType(IntegerValue::class)));
41  }

◆ testListValue()

ValueTest::testListValue ( )

Definition at line 43 of file ValueTest.php.

References $list.

44  {
45  $list = new ListValue();
46  $list->setValue([1, 2, 3]);
47 
48  $list2 = new ListValue();
49  $integer1 = new IntegerValue();
50  $integer1->setValue(1);
51  $string = new StringValue();
52  $string->setValue("1");
53  $list2->setValue([$integer1, $string]);
54 
55  $this->assertTrue($list->getType()->equals(new ListType(IntegerValue::class)));
56  $this->assertTrue($list2->getType()->equals(new ListType(ScalarValue::class)));
57  }
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41

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