ILIAS
trunk Revision v11.0_alpha-2645-g16283d3b3f8
◀ ilDoc Overview
PCVerificationTest.php
Go to the documentation of this file.
1
<?php
2
19
use
PHPUnit\Framework\TestCase
;
20
24
class
PCVerificationTest
extends
COPageTestBase
25
{
26
public
function
testConstruction
(): void
27
{
28
$page = $this->
getEmptyPageWithDom
();
29
$pc =
new
ilPCVerification
($page);
30
$this->assertEquals(
31
ilPCVerification::class,
32
get_class($pc)
33
);
34
}
35
36
public
function
testCreate
(): void
37
{
38
$page = $this->
getEmptyPageWithDom
();
39
$pc =
new
ilPCVerification
($page);
40
$pc->create($page,
"pg"
,
""
);
41
$this->
assertXmlEquals
(
42
'<PageObject HierId="pg"><PageContent><Verification></Verification></PageContent></PageObject>'
,
43
$page->getXMLFromDom()
44
);
45
}
46
47
public
function
testData
(): void
48
{
49
$page = $this->
getEmptyPageWithDom
();
50
$pc =
new
ilPCVerification
($page);
51
$pc->create($page,
"pg"
,
""
);
52
$pc->setData(
"mytype"
, 20);
53
54
$this->assertEquals(
55
[
56
"id"
=> 20,
57
"type"
=>
"mytype"
,
58
"user"
=> 0
59
],
60
$pc->getData()
61
);
62
63
$page->stripHierIDs();
64
65
$expected = <<<EOT
66
<PageObject><PageContent><Verification
Type
=
"mytype"
Id
=
"20"
User=
"0"
></Verification></PageContent></PageObject>
67
EOT;
68
$this->
assertXmlEquals
(
69
$expected,
70
$page->getXMLFromDom()
71
);
72
}
73
}
COPageTestBase
Definition:
COPageTestBase.php:24
PCVerificationTest\testCreate
testCreate()
Definition:
PCVerificationTest.php:36
PCVerificationTest\testConstruction
testConstruction()
Definition:
PCVerificationTest.php:26
PCVerificationTest
Definition:
PCVerificationTest.php:24
PCVerificationTest\testData
testData()
Definition:
PCVerificationTest.php:47
IdentificationInterface
ilPCVerification
Class ilPCVerification Verification content object (see ILIAS DTD)
Definition:
class.ilPCVerification.php:26
ILIAS\AdvancedMetaData\Data\FieldDefinition\Type
Type
Definition:
Type.php:23
COPageTestBase\getEmptyPageWithDom
getEmptyPageWithDom()
Definition:
COPageTestBase.php:207
TestCase
COPageTestBase\assertXmlEquals
assertXmlEquals(string $expected_xml_as_string, string $html_xml_string)
Definition:
COPageTestBase.php:193
components
ILIAS
COPage
tests
PCVerificationTest.php
Generated on Mon Sep 1 2025 23:02:49 for ILIAS by
1.8.13 (using
Doxyfile
)