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

Public Member Functions

 testConstruction ()
 
 testCreate ()
 
 testContentClass ()
 
 testHeight ()
 

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

Member Function Documentation

◆ testConstruction()

PCPlaceholderTest::testConstruction ( )

Definition at line 26 of file PCPlaceholderTest.php.

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

References COPageTestBase\getEmptyPageWithDom().

+ Here is the call graph for this function:

◆ testContentClass()

PCPlaceholderTest::testContentClass ( )

Definition at line 47 of file PCPlaceholderTest.php.

47 : void
48 {
49 $page = $this->getEmptyPageWithDom();
50 $pc = new ilPCPlaceHolder($page);
51 $pc->create($page, "pg");
52 $pc->setContentClass("MyClass");
53
54 $this->assertEquals(
55 "MyClass",
56 $pc->getContentClass()
57 );
58
59 $page->stripHierIDs();
60
61 $expected = <<<EOT
62<PageObject><PageContent><PlaceHolder ContentClass="MyClass"></PlaceHolder></PageContent></PageObject>
63EOT;
64 $this->assertXmlEquals(
65 $expected,
66 $page->getXMLFromDom()
67 );
68 }
assertXmlEquals(string $expected_xml_as_string, string $html_xml_string)

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

+ Here is the call graph for this function:

◆ testCreate()

PCPlaceholderTest::testCreate ( )

Definition at line 36 of file PCPlaceholderTest.php.

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

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

+ Here is the call graph for this function:

◆ testHeight()

PCPlaceholderTest::testHeight ( )

Definition at line 70 of file PCPlaceholderTest.php.

70 : void
71 {
72 $page = $this->getEmptyPageWithDom();
73 $pc = new ilPCPlaceHolder($page);
74 $pc->create($page, "pg");
75 $pc->setHeight("300");
76
77 $this->assertEquals(
78 "300",
79 $pc->getHeight()
80 );
81
82 $page->stripHierIDs();
83
84 $expected = <<<EOT
85<PageObject><PageContent><PlaceHolder Height="300"></PlaceHolder></PageContent></PageObject>
86EOT;
87 $this->assertXmlEquals(
88 $expected,
89 $page->getXMLFromDom()
90 );
91 }

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: