ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
TypeTest Class Reference

Class BackgroundTaskTest. More...

+ Inheritance diagram for TypeTest:
+ Collaboration diagram for TypeTest:

Public Member Functions

 testAncestors ()
 
 testListSubtypes ()
 
 testListAncestor ()
 
 testListOfLists ()
 
 testTuple ()
 

Detailed Description

Class BackgroundTaskTest.

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

Definition at line 16 of file TypeTest.php.

Member Function Documentation

◆ testAncestors()

TypeTest::testAncestors ( )

Definition at line 18 of file TypeTest.php.

19  {
20  $integer = new SingleType(\ilObjUser::class);
21  $ancestors = $integer->getAncestors();
22 
23  $this->assertTrue($ancestors[0]->equals(new SingleType(\ilObject::class)));
24  $this->assertTrue($ancestors[1]->equals(new SingleType(\ilObjUser::class)));
25  }

◆ testListAncestor()

TypeTest::testListAncestor ( )

Definition at line 36 of file TypeTest.php.

37  {
38  $integerList = new ListType(new SingleType(\ilObjUser::class));
39  $ancestors = $integerList->getAncestors();
40 
41  $this->assertTrue($ancestors[0]->equals(new ListType(\ilObject::class)));
42  $this->assertTrue($ancestors[1]->equals(new ListType(\ilObjUser::class)));
43  }

◆ testListOfLists()

TypeTest::testListOfLists ( )

Definition at line 45 of file TypeTest.php.

References $list.

46  {
47  $list = new ListType(\ilObjUser::class);
48  $list1 = new ListType(\ilObject::class);
49  $listlist = new ListType($list);
50  $listlist1 = new ListType($list1);
51 
52  $this->assertTrue($listlist->equals(new ListType(new ListType(\ilObjUser::class))));
53  $this->assertTrue($listlist->isExtensionOf($listlist1));
54  $this->assertFalse($listlist1->isExtensionOf($listlist));
55  }
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41

◆ testListSubtypes()

TypeTest::testListSubtypes ( )

Definition at line 27 of file TypeTest.php.

28  {
29  $scalarList = new ListType(new SingleType(\ilObjUser::class));
30  $scalarList3 = new ListType(new SingleType(\ilObjUser::class));
31 
32  $this->assertTrue($scalarList3->isExtensionOf($scalarList));
33  $this->assertTrue($scalarList->isExtensionOf($scalarList));
34  }

◆ testTuple()

TypeTest::testTuple ( )

Definition at line 57 of file TypeTest.php.

58  {
59  $tuple1 = new TupleType([\ilObjUser::class, new ListType(\ilObject::class)]);
60  $tuple2 = new TupleType([\ilObjUser::class, new ListType(\ilObjUser::class)]);
61 
62  $this->assertEquals($tuple1->__toString(), '(ilObjUser, [ilObject])');
63  $this->assertTrue($tuple2->isExtensionOf($tuple1));
64  $this->assertFalse($tuple1->isExtensionOf($tuple2));
65  }

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