Your IP : 216.73.216.43


Current Path : /proc/thread-self/root/home/rtorresani/www/vendor/phpgt/dom/test/phpunit/
Upload File :
Current File : //proc/thread-self/root/home/rtorresani/www/vendor/phpgt/dom/test/phpunit/AttrTest.php

<?php
namespace Gt\Dom\Test;

use Gt\Dom\HTMLDocument;
use Gt\Dom\Test\Helper\Helper;
use Gt\Dom\TokenList;
use PHPUnit\Framework\TestCase;

class AttrTest extends TestCase {
	public function testAttrMove() {
		$document = new HTMLDocument(Helper::DOCS_ATTR_GETATTRIBUTENODE);
		$arduinoElement = $document->getElementById("arduino");
		$raspberryPiElement = $document->getElementById("raspberry-pi");

		// Reference the attribute, remove it from its current parent, reattach it to new parent.
		$attribute = $raspberryPiElement->getAttributeNode("class");
		$raspberryPiElement->removeAttributeNode($attribute);
		$arduinoElement->setAttributeNode($attribute);

		$this->assertSame($attribute, $arduinoElement->getAttributeNode("class"));
		$this->assertFalse($raspberryPiElement->getAttributeNode("class"));
	}
}