poop💩 ook eek', 'UTF-8'); $body = $d->body; $body->firstChild->splitText(5); $this->assertSame('poop💩', $body->firstChild->data); } public function testMethod_splitText__errors(): void { $this->expectException(DOMException::class); $this->expectExceptionCode(DOMException::INDEX_SIZE_ERROR); $d = new Document('poop💩 ook eek', 'UTF-8'); $body = $d->body; $body->firstChild->splitText(2112); } public function testProperty_wholeText(): void { $d = new Document('ook ack eek'); $body = $d->body; $body->removeChild($body->getElementsByTagName('strong')[0]); $this->assertSame('ook eek', $body->firstChild->wholeText); } }