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

Public Member Functions

 testConstruction ()
 
 testCreate ()
 
 testQuestionReference ()
 

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

Member Function Documentation

◆ testConstruction()

PCQuestionTest::testConstruction ( )

Definition at line 26 of file PCQuestionTest.php.

References COPageTestBase\getEmptyPageWithDom().

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

PCQuestionTest::testCreate ( )

Definition at line 36 of file PCQuestionTest.php.

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

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

◆ testQuestionReference()

PCQuestionTest::testQuestionReference ( )

Definition at line 47 of file PCQuestionTest.php.

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

47  : void
48  {
49  $page = $this->getEmptyPageWithDom();
50  $pc = new ilPCQuestion($page);
51  $pc->create($page, "pg", "");
52  $pc->setQuestionReference("qref1");
53 
54  $this->assertEquals(
55  "qref1",
56  $pc->getQuestionReference()
57  );
58 
59  $page->stripHierIDs();
60 
61  $expected = <<<EOT
62 <PageObject><PageContent><Question QRef="qref1"></Question></PageContent></PageObject>
63 EOT;
64  $this->assertXmlEquals(
65  $expected,
66  $page->getXMLFromDom()
67  );
68  }
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: