ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
PCProfileTest Class Reference
+ Inheritance diagram for PCProfileTest:
+ Collaboration diagram for PCProfileTest:

Public Member Functions

 testConstruction ()
 
 testCreate ()
 
 testFields ()
 
 testFieldsAll ()
 

Additional Inherited Members

- Protected Member Functions inherited from COPageTestBase
 setGlobalVariable (string $name, $value)
 
 setUp ()
 
 getIdGeneratorMock ()
 
 getPCDefinition ()
 
 setPCIdCnt (int $cnt)
 
 getIDManager (\ilPageObject $page)
 
 insertParagraphAt (\ilPageObject $page, string $hier_id, string $text="")
 
 tearDown ()
 
 normalize (string $html)
 
 assertXmlEquals (string $expected_xml_as_string, string $html_xml_string)
 
 getEmptyPageWithDom ()
 
 legacyHtmlToXml (string $content)
 
 getMediaObjectMock ()
 
- Protected Attributes inherited from COPageTestBase
int $pc_cnt
 

Detailed Description

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 24 of file PCProfileTest.php.

Member Function Documentation

◆ testConstruction()

PCProfileTest::testConstruction ( )

Definition at line 26 of file PCProfileTest.php.

References COPageTestBase\getEmptyPageWithDom().

26  : void
27  {
28  $page = $this->getEmptyPageWithDom();
29  $pc = new ilPCProfile($page);
30  $this->assertEquals(
31  ilPCProfile::class,
32  get_class($pc)
33  );
34  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ testCreate()

PCProfileTest::testCreate ( )

Definition at line 36 of file PCProfileTest.php.

References COPageTestBase\assertXmlEquals(), and COPageTestBase\getEmptyPageWithDom().

36  : void
37  {
38  $page = $this->getEmptyPageWithDom();
39  $pc = new ilPCProfile($page);
40  $pc->create($page, "pg", "", "MyPlugin", "1.0");
41  $this->assertXmlEquals(
42  '<PageObject HierId="pg"><PageContent><Profile></Profile></PageContent></PageObject>',
43  $page->getXMLFromDom()
44  );
45  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
assertXmlEquals(string $expected_xml_as_string, string $html_xml_string)
+ Here is the call graph for this function:

◆ testFields()

PCProfileTest::testFields ( )

Definition at line 47 of file PCProfileTest.php.

References COPageTestBase\assertXmlEquals(), and COPageTestBase\getEmptyPageWithDom().

47  : void
48  {
49  $page = $this->getEmptyPageWithDom();
50  $pc = new ilPCProfile($page);
51  $pc->create($page, "pg", "");
52  $pc->setFields(
53  "manual",
54  [
55  "Firstname","Lastname"
56  ]
57  );
58 
59  $this->assertEquals(
60  [
61  0 => "Firstname",
62  1 => "Lastname"
63  ],
64  $pc->getFields()
65  );
66 
67  $this->assertEquals(
68  "manual",
69  $pc->getMode()
70  );
71 
72  $page->stripHierIDs();
73 
74  $expected = <<<EOT
75 <PageObject><PageContent><Profile Mode="manual" User="0"><ProfileField Name="Firstname"></ProfileField><ProfileField Name="Lastname"></ProfileField></Profile></PageContent></PageObject>
76 EOT;
77  $this->assertXmlEquals(
78  $expected,
79  $page->getXMLFromDom()
80  );
81  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
assertXmlEquals(string $expected_xml_as_string, string $html_xml_string)
+ Here is the call graph for this function:

◆ testFieldsAll()

PCProfileTest::testFieldsAll ( )

Definition at line 83 of file PCProfileTest.php.

References COPageTestBase\assertXmlEquals(), and COPageTestBase\getEmptyPageWithDom().

83  : void
84  {
85  $page = $this->getEmptyPageWithDom();
86  $pc = new ilPCProfile($page);
87  $pc->create($page, "pg", "");
88  $pc->setFields(
89  "all"
90  );
91 
92  $this->assertEquals(
93  [
94  ],
95  $pc->getFields()
96  );
97 
98  $this->assertEquals(
99  "all",
100  $pc->getMode()
101  );
102 
103  $page->stripHierIDs();
104 
105  $expected = <<<EOT
106 <PageObject><PageContent><Profile Mode="all" User="0"></Profile></PageContent></PageObject>
107 EOT;
108  $this->assertXmlEquals(
109  $expected,
110  $page->getXMLFromDom()
111  );
112  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
assertXmlEquals(string $expected_xml_as_string, string $html_xml_string)
+ Here is the call graph for this function:

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