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

Public Member Functions

 testConstruction ()
 
 testCreate ()
 
 testResourceListType ()
 
 testItemGroupRefId ()
 

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

Member Function Documentation

◆ testConstruction()

PCResourcesTest::testConstruction ( )

Definition at line 26 of file PCResourcesTest.php.

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

◆ testCreate()

PCResourcesTest::testCreate ( )

Definition at line 36 of file PCResourcesTest.php.

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

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

+ Here is the call graph for this function:

◆ testItemGroupRefId()

PCResourcesTest::testItemGroupRefId ( )

Definition at line 74 of file PCResourcesTest.php.

74 : void
75 {
76 $page = $this->getEmptyPageWithDom();
77 $pc = new ilPCResources($page);
78 $pc->create($page, "pg", "");
79 $pc->setItemGroupRefId(22);
80
81 $this->assertEquals(
82 22,
83 $pc->getItemGroupRefId()
84 );
85 $this->assertEquals(
86 "ItemGroup",
87 $pc->getMainType()
88 );
89
90 $page->stripHierIDs();
91
92 $expected = <<<EOT
93<PageObject><PageContent><Resources><ItemGroup RefId="22"></ItemGroup></Resources></PageContent></PageObject>
94EOT;
95 $this->assertXmlEquals(
96 $expected,
97 $page->getXMLFromDom()
98 );
99 }

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

+ Here is the call graph for this function:

◆ testResourceListType()

PCResourcesTest::testResourceListType ( )

Definition at line 47 of file PCResourcesTest.php.

47 : void
48 {
49 $page = $this->getEmptyPageWithDom();
50 $pc = new ilPCResources($page);
51 $pc->create($page, "pg", "");
52 $pc->setResourceListType("glo");
53
54 $this->assertEquals(
55 "glo",
56 $pc->getResourceListType()
57 );
58 $this->assertEquals(
59 "ResourceList",
60 $pc->getMainType()
61 );
62
63 $page->stripHierIDs();
64
65 $expected = <<<EOT
66<PageObject><PageContent><Resources><ResourceList Type="glo"></ResourceList></Resources></PageContent></PageObject>
67EOT;
68 $this->assertXmlEquals(
69 $expected,
70 $page->getXMLFromDom()
71 );
72 }

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: