ILIAS  trunk Revision v11.0_alpha-2658-ge2404539063
PCPluggedTest Class Reference
+ Inheritance diagram for PCPluggedTest:
+ Collaboration diagram for PCPluggedTest:

Public Member Functions

 testConstruction ()
 
 testCreate ()
 
 testProperties ()
 
 testVersion ()
 
 testName ()
 

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 PCPluggedTest.php.

Member Function Documentation

◆ testConstruction()

PCPluggedTest::testConstruction ( )

Definition at line 26 of file PCPluggedTest.php.

References COPageTestBase\getEmptyPageWithDom().

26  : void
27  {
28  $page = $this->getEmptyPageWithDom();
29  $pc = new ilPCPlugged($page);
30  $this->assertEquals(
31  ilPCPlugged::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()

PCPluggedTest::testCreate ( )

Definition at line 36 of file PCPluggedTest.php.

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

36  : void
37  {
38  $page = $this->getEmptyPageWithDom();
39  $pc = new ilPCPlugged($page);
40  $pc->create($page, "pg", "", "MyPlugin", "1.0");
41  $this->assertXmlEquals(
42  '<PageObject HierId="pg"><PageContent><Plugged PluginName="MyPlugin" PluginVersion="1.0"></Plugged></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:

◆ testName()

PCPluggedTest::testName ( )

Definition at line 99 of file PCPluggedTest.php.

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

99  : void
100  {
101  $page = $this->getEmptyPageWithDom();
102  $pc = new ilPCPlugged($page);
103  $pc->create($page, "pg", "", "MyPlugin", "1.0");
104  $pc->setPluginName("YourPlugin");
105 
106  $this->assertEquals(
107  "YourPlugin",
108  $pc->getPluginName()
109  );
110 
111  $page->stripHierIDs();
112 
113  $expected = <<<EOT
114 <PageObject><PageContent><Plugged PluginName="YourPlugin" PluginVersion="1.0"></Plugged></PageContent></PageObject>
115 EOT;
116  $this->assertXmlEquals(
117  $expected,
118  $page->getXMLFromDom()
119  );
120  }
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:

◆ testProperties()

PCPluggedTest::testProperties ( )

Definition at line 47 of file PCPluggedTest.php.

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

47  : void
48  {
49  $page = $this->getEmptyPageWithDom();
50  $pc = new ilPCPlugged($page);
51  $pc->create($page, "pg", "", "MyPlugin", "1.0");
52  $pc->setProperties([
53  "prop1" => "val1",
54  "prop2" => "val2",
55  ]);
56 
57  $this->assertEquals(
58  [
59  "prop1" => "val1",
60  "prop2" => "val2",
61  ],
62  $pc->getProperties()
63  );
64 
65  $page->stripHierIDs();
66 
67  $expected = <<<EOT
68 <PageObject><PageContent><Plugged PluginName="MyPlugin" PluginVersion="1.0"><PluggedProperty Name="prop1">val1</PluggedProperty><PluggedProperty Name="prop2">val2</PluggedProperty></Plugged></PageContent></PageObject>
69 EOT;
70  $this->assertXmlEquals(
71  $expected,
72  $page->getXMLFromDom()
73  );
74  }
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:

◆ testVersion()

PCPluggedTest::testVersion ( )

Definition at line 76 of file PCPluggedTest.php.

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

76  : void
77  {
78  $page = $this->getEmptyPageWithDom();
79  $pc = new ilPCPlugged($page);
80  $pc->create($page, "pg", "", "MyPlugin", "1.0");
81  $pc->setPluginVersion("2.0");
82 
83  $this->assertEquals(
84  "2.0",
85  $pc->getPluginVersion()
86  );
87 
88  $page->stripHierIDs();
89 
90  $expected = <<<EOT
91 <PageObject><PageContent><Plugged PluginName="MyPlugin" PluginVersion="2.0"></Plugged></PageContent></PageObject>
92 EOT;
93  $this->assertXmlEquals(
94  $expected,
95  $page->getXMLFromDom()
96  );
97  }
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: