diff --git a/tests/Issues/Issue49Test.php b/tests/Issues/Issue49Test.php new file mode 100644 index 0000000..2ccabfd --- /dev/null +++ b/tests/Issues/Issue49Test.php @@ -0,0 +1,31 @@ +', 'div'); + + /* Check if the DOMNode or its children matches */ + $this->assertTrue($q->is(':text')); + $this->assertCount(2, $q->find(':text')); + + $textNode = $q->find('div')->contents()->eq(0); + $this->assertTrue($textNode->is(':text')); + } + + public function testCheckingForEmptyTextInputs(): void + { + $q = html5qp('
Sample
', 'div'); + + /* Check if the DOMNode or its children matches */ + $this->assertFalse($q->is(':text')); + $this->assertCount(0, $q->find(':text')); + + /* check if a text node matches */ + $textNode = $q->find('div')->contents()->eq(0); + $this->assertFalse($textNode->is(':text')); + } +} \ No newline at end of file