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

Class ilObjDataCollectionTest @group needsInstalledILIAS. More...

+ Inheritance diagram for ilObjDataCollectionTest:
+ Collaboration diagram for ilObjDataCollectionTest:

Public Member Functions

 testCreation ()
 Test creation of ilObjStudyProgramme. More...
 
 testDefaultTableCreated ()
 
 testDefaultTable (ilDclTable $table)
 @depends testDefaultTableCreated More...
 
 testDefaultTableViewCreated (ilDclTable $table)
 @depends testDefaultTableCreated More...
 
 testDefaultTableView (array $array)
 @depends testDefaultTableViewCreated More...
 
 testDefaultTableViewFieldSettings (array $array)
 @depends testDefaultTableViewCreated More...
 

Protected Member Functions

 setUp ()
 
 tearDown ()
 

Protected Attributes

 $root_object
 
 $backupGlobals = false
 

Detailed Description

Class ilObjDataCollectionTest @group needsInstalledILIAS.

Author
Theodor Truffer tt@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 10 of file ilObjDataCollectionTest.php.

Member Function Documentation

◆ setUp()

ilObjDataCollectionTest::setUp ( )
protected

Definition at line 19 of file ilObjDataCollectionTest.php.

20 {
21 PHPUnit_Framework_Error_Deprecated::$enabled = false;
22// PHPUnit_Framework_Error_Warning::$enabled = FALSE;
23// PHPUnit_Framework_Error_Notice::$enabled = FALSE;
24 parent::setUp();
25
26 require_once("./Modules/DataCollection/classes/class.ilObjDataCollection.php");
27
28 include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
29 ilUnitUtil::performInitialisation();
30 $this->root_object = new ilObjDataCollection();
31 $this->root_object->setTitle('DataCollection');
32
33 $this->root_object->create();
34 $this->root_object->createReference();
35 $this->root_object_obj_id = $this->root_object->getId();
36 $this->root_object_ref_id = $this->root_object->getRefId();
37 $this->root_object->putInTree(ROOT_FOLDER_ID);
38
39 //
40
41 global $DIC;
42 $tree = $DIC['tree'];
43 $this->tree = $tree;
44
45 global $DIC;
46 $objDefinition = $DIC['objDefinition'];
47 $this->obj_definition = $objDefinition;
48 }
Class ilObjDataCollection.
global $DIC
Definition: saml.php:7

References $DIC.

◆ tearDown()

ilObjDataCollectionTest::tearDown ( )
protected

Definition at line 50 of file ilObjDataCollectionTest.php.

51 {
52 if ($this->root_object) {
53 $this->root_object->delete();
54 }
55 }

◆ testCreation()

ilObjDataCollectionTest::testCreation ( )

Test creation of ilObjStudyProgramme.

Definition at line 60 of file ilObjDataCollectionTest.php.

61 {
62 $this->assertNotEmpty($this->root_object_obj_id);
63 $this->assertGreaterThan(0, $this->root_object_obj_id);
64
65 $this->assertNotEmpty($this->root_object_ref_id);
66 $this->assertGreaterThan(0, $this->root_object_ref_id);
67
68 $this->assertTrue($this->tree->isInTree($this->root_object_ref_id));
69 }

◆ testDefaultTable()

ilObjDataCollectionTest::testDefaultTable ( ilDclTable  $table)

@depends testDefaultTableCreated

Definition at line 84 of file ilObjDataCollectionTest.php.

85 {
86// $this->assertEquals($table->getId(), $this->root_object->getMainTableId());
87 $this->assertEquals($table->getTitle(), $this->root_object->getTitle());
88// $this->assertEquals($table->getObjId(), $this->root_object_obj_id);
89 $this->assertFalse((bool) $table->getPublicCommentsEnabled());
90 $this->assertEmpty($table->getRecords());
91 $this->assertEmpty($table->getRecordFields());
92 $this->assertEquals(count($table->getFields()), count($table->getStandardFields()));
93
94 $this->assertTrue($this->root_object->_hasTableByTitle($this->root_object->getTitle(), $this->root_object_obj_id));
95 }
if(empty($password)) $table
Definition: pwgen.php:24

References $table.

◆ testDefaultTableCreated()

ilObjDataCollectionTest::testDefaultTableCreated ( )

Definition at line 71 of file ilObjDataCollectionTest.php.

72 {
73 $tables = $this->root_object->getTables();
74 $this->assertEquals(count($tables), 1);
75
76 $table = array_shift($tables);
77 $this->assertTrue($table instanceof ilDclTable);
78 return $table;
79 }
Class ilDclBaseFieldModel.

References $table.

◆ testDefaultTableView()

ilObjDataCollectionTest::testDefaultTableView ( array  $array)

@depends testDefaultTableViewCreated

Definition at line 113 of file ilObjDataCollectionTest.php.

114 {
115 $this->assertEquals(count(ilDclTableView::getAllForTableId($array['table']->getId())), 1);
116 $this->assertEquals($array['tableview']->getTable(), $array['table']);
117
118 $this->assertEquals($array['tableview']->getOrder(), 10);
119 }
static getAllForTableId($table_id)

References ilDclTableView\getAllForTableId().

+ Here is the call graph for this function:

◆ testDefaultTableViewCreated()

ilObjDataCollectionTest::testDefaultTableViewCreated ( ilDclTable  $table)

@depends testDefaultTableCreated

Definition at line 100 of file ilObjDataCollectionTest.php.

101 {
102 $tableviews = $table->getTableViews();
103 $this->assertEquals(count($tableviews), 1);
104
105 $tableview = array_shift($tableviews);
106 $this->assertTrue($tableview instanceof ilDclTableView);
107 return array('table' => $table, 'tableview' => $tableview);
108 }
Class ilDclTableView.

References $table.

◆ testDefaultTableViewFieldSettings()

ilObjDataCollectionTest::testDefaultTableViewFieldSettings ( array  $array)

@depends testDefaultTableViewCreated

Definition at line 124 of file ilObjDataCollectionTest.php.

125 {
126 $field_settings = $array['tableview']->getFieldSettings();
127// $this->assertEquals(count($field_settings), count($array['table']->getFields()) - $array['table']->getPublicCommentsEnabled());
128
129 foreach ($array['table']->getFields() as $field) {
130 $f_sets = $field->getFieldSettings();
131 $this->assertNotEmpty($f_sets);
132 }
133 }

Field Documentation

◆ $backupGlobals

ilObjDataCollectionTest::$backupGlobals = false
protected

Definition at line 17 of file ilObjDataCollectionTest.php.

◆ $root_object

ilObjDataCollectionTest::$root_object
protected

Definition at line 15 of file ilObjDataCollectionTest.php.


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