ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
PCContentIncludeTest Class Reference
+ Inheritance diagram for PCContentIncludeTest:
+ Collaboration diagram for PCContentIncludeTest:

Public Member Functions

 testConstruction ()
 
 testCreate ()
 
 testContentId ()
 
 testContentType ()
 
 testInstId ()
 
 testCollectContentIncludes ()
 

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

Member Function Documentation

◆ testCollectContentIncludes()

PCContentIncludeTest::testCollectContentIncludes ( )

Definition at line 113 of file PCContentIncludeTest.php.

113 : void
114 {
115 $page = $this->getEmptyPageWithDom();
116 $pc = new ilPCContentInclude($page);
117 $pc->create($page, "pg");
118 $pc->setInstId("123");
119 $pc->setContentType("type");
120 $pc->setContentId(55);
121
122 $includes = ilPCContentInclude::collectContentIncludes($page, $page->getDomDoc());
123
124 $this->assertEquals(
125 ['type:55:123' => [
126 "type" => "type",
127 "id" => "55",
128 "inst_id" => "123"
129 ]],
130 $includes
131 );
132 }
Class ilPCContentInclude.
static collectContentIncludes(ilPageObject $a_page, DOMDocument $a_domdoc)
get all content includes that are used within the page

References ilPCContentInclude\collectContentIncludes(), and COPageTestBase\getEmptyPageWithDom().

+ Here is the call graph for this function:

◆ testConstruction()

PCContentIncludeTest::testConstruction ( )

Definition at line 26 of file PCContentIncludeTest.php.

26 : void
27 {
28 $page = $this->getEmptyPageWithDom();
29 $pc = new ilPCContentInclude($page);
30 $this->assertEquals(
31 ilPCContentInclude::class,
32 get_class($pc)
33 );
34 }

References COPageTestBase\getEmptyPageWithDom().

+ Here is the call graph for this function:

◆ testContentId()

PCContentIncludeTest::testContentId ( )

Definition at line 47 of file PCContentIncludeTest.php.

47 : void
48 {
49 $page = $this->getEmptyPageWithDom();
50 $pc = new ilPCContentInclude($page);
51 $pc->create($page, "pg");
52 $pc->setContentId("10");
53
54 $this->assertEquals(
55 "10",
56 $pc->getContentId()
57 );
58
59 $expected = <<<EOT
60<PageObject HierId="pg"><PageContent><ContentInclude ContentId="10"></ContentInclude></PageContent></PageObject>
61EOT;
62
63 $this->assertXmlEquals(
64 $expected,
65 $page->getXMLFromDom()
66 );
67 }
assertXmlEquals(string $expected_xml_as_string, string $html_xml_string)

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

+ Here is the call graph for this function:

◆ testContentType()

PCContentIncludeTest::testContentType ( )

Definition at line 69 of file PCContentIncludeTest.php.

69 : void
70 {
71 $page = $this->getEmptyPageWithDom();
72 $pc = new ilPCContentInclude($page);
73 $pc->create($page, "pg");
74 $pc->setContentType("type");
75
76 $this->assertEquals(
77 "type",
78 $pc->getContentType()
79 );
80
81 $expected = <<<EOT
82<PageObject HierId="pg"><PageContent><ContentInclude ContentType="type"></ContentInclude></PageContent></PageObject>
83EOT;
84
85 $this->assertXmlEquals(
86 $expected,
87 $page->getXMLFromDom()
88 );
89 }

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

+ Here is the call graph for this function:

◆ testCreate()

PCContentIncludeTest::testCreate ( )

Definition at line 36 of file PCContentIncludeTest.php.

36 : void
37 {
38 $page = $this->getEmptyPageWithDom();
39 $pc = new ilPCContentInclude($page);
40 $pc->create($page, "pg");
41 $this->assertXmlEquals(
42 '<PageObject HierId="pg"><PageContent><ContentInclude></ContentInclude></PageContent></PageObject>',
43 $page->getXMLFromDom()
44 );
45 }

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

+ Here is the call graph for this function:

◆ testInstId()

PCContentIncludeTest::testInstId ( )

Definition at line 91 of file PCContentIncludeTest.php.

91 : void
92 {
93 $page = $this->getEmptyPageWithDom();
94 $pc = new ilPCContentInclude($page);
95 $pc->create($page, "pg");
96 $pc->setInstId("123");
97
98 $this->assertEquals(
99 "123",
100 $pc->getInstId()
101 );
102
103 $expected = <<<EOT
104<PageObject HierId="pg"><PageContent><ContentInclude InstId="123"></ContentInclude></PageContent></PageObject>
105EOT;
106
107 $this->assertXmlEquals(
108 $expected,
109 $page->getXMLFromDom()
110 );
111 }

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

+ Here is the call graph for this function:

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