Your IP : 216.73.216.14


Current Path : /var/www/magento.test.indacotrentino.com/www/vendor/phpgt/dom/test/phpunit/
Upload File :
Current File : /var/www/magento.test.indacotrentino.com/www/vendor/phpgt/dom/test/phpunit/DocumentFragmentTest.php

<?php
namespace Gt\Dom\Test;

use Gt\Dom\DocumentFragment;
use Gt\Dom\HTMLDocument;
use Gt\Dom\Test\TestFactory\NodeTestFactory;
use PHPUnit\Framework\TestCase;

class DocumentFragmentTest extends TestCase {
	public function testGetElementByIdEmpty():void {
		$document = new HTMLDocument();
		$sut = $document->createDocumentFragment();
		self::assertNull($sut->getElementById("nothing"));
	}

	public function testGetElementById():void {
		$document = new HTMLDocument();
		$sut = $document->createDocumentFragment();
		$nodeWithId = $sut->ownerDocument->createElement("div");
		$nodeWithId->id = "test";
		$sut->appendChild($nodeWithId);
		self::assertSame($nodeWithId, $sut->getElementById("test"));
	}
}