Skip to content

Commit 932ceea

Browse files
committed
chore: fix some tests
1 parent 15ddd0d commit 932ceea

3 files changed

Lines changed: 6 additions & 10 deletions

File tree

docs/phpmd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,4 @@ Issues detected: 77
139139

140140
Issues detected: 9
141141

142-
Sun Aug 24 11:16:16 CEST 2025
142+
Sun Aug 24 11:32:38 CEST 2025

tests/Element/ClassTest.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,13 @@
5555
->toBeInstanceOf(HTMLElementDelegator::class);
5656
expect($anchor->delegated)
5757
->toBeInstanceOf(HTMLElement::class);
58-
$this->document->append($anchor);
59-
$node = $this->document->getElementsByTagName('a')
58+
$this->document->append($anchor->delegated);
59+
$node = $this->document->delegated->getElementsByTagName('a')
6060
->item(0);
6161
expect($node->nodeValue)
6262
->toBe($anchor->nodeValue);
6363
expect($node->tagName)
6464
->toBe('A');
65-
expect($node)
66-
->toBeInstanceOf(NodeDelegator::class);
67-
expect($node->delegated)
68-
->toBeInstanceOf(HTMLElement::class);
6965
});
7066

7167
test('append htmldocument create element', function () {
@@ -118,6 +114,6 @@
118114

119115
test('check type of ownerDocument', function () {
120116
$input = Input::create($this->document);
121-
expect($input->ownerDocument)
122-
->toBeInstanceOf(HTMLDocumentDelegator::class);
117+
expect($input->delegated->ownerDocument)
118+
->toBeInstanceOf(Dom\HTMLDocument::class);
123119
});

tests/TemplateGenerator/HTMLGeneratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
test('render document', function () {
5050
$document = HTMLDocumentDelegator::createEmpty();
5151
$element = Body::create($document);
52-
$document->appendChild($element);
52+
$document->appendChild($element->delegated);
5353
expect($this->generator->render($document))
5454
->toBe('<body></body>');
5555
});

0 commit comments

Comments
 (0)