ILIAS
trunk Revision v11.0_alpha-2638-g80c1d007f79
◀ ilDoc Overview
PCFactoryTest.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\COPage\Test\PC
;
22
23
use
PHPUnit\Framework\TestCase
;
24
use
ILIAS\COPage\PC\PCFactory
;
25
use
ILIAS\COPage\Page\PageContentManager
;
26
30
class
PCFactoryTest
extends
\COPageTestBase
31
{
32
public
function
testGetByNode
(): void
33
{
34
global
$DIC
;
35
36
$dom_util = new \ILIAS\COPage\Dom\DomUtil();
37
$page = $this->
getEmptyPageWithDom
();
38
$page_content =
new
PageContentManager($page->getDomDoc());
39
$pc_factory =
new
PCFactory($def = $this->
getPCDefinition
());
40
41
$this->
insertParagraphAt
($page,
"pg"
,
"Hello"
);
42
$this->
insertParagraphAt
($page,
"1"
,
"World"
);
43
$page->insertPCIds();
44
45
$node = $page_content->getContentDomNode(
"1"
);
46
$pc = $pc_factory->getByNode($node, $page);
47
48
$this->assertEquals(
49
\ilPCParagraph::class,
50
get_class($pc)
51
);
52
53
$this->assertEquals(
54
"Hello"
,
55
$pc->getText()
56
);
57
}
58
}
COPageTestBase\insertParagraphAt
insertParagraphAt(\ilPageObject $page, string $hier_id, string $text="")
Definition:
COPageTestBase.php:170
COPageTestBase
Definition:
COPageTestBase.php:24
ILIAS\COPage\Test\PC
COPageTestBase\getPCDefinition
getPCDefinition()
Definition:
COPageTestBase.php:152
$DIC
global $DIC
Definition:
shib_login.php:26
PCFactory
COPageTestBase\getEmptyPageWithDom
getEmptyPageWithDom()
Definition:
COPageTestBase.php:207
PageContentManager
TestCase
PHPUnit::Framework::Attributes\Test::PC\PCFactoryTest\testGetByNode
testGetByNode()
Definition:
PCFactoryTest.php:32
PHPUnit::Framework::Attributes\Test::PC\PCFactoryTest
Definition:
PCFactoryTest.php:30
components
ILIAS
COPage
tests
PC
PCFactoryTest.php
Generated on Sun Aug 31 2025 23:02:41 for ILIAS by
1.8.13 (using
Doxyfile
)