--TEST--
GH-10234 (Setting DOMAttr::textContent results in an empty attribute value.)
--EXTENSIONS--
dom
--FILE--
loadXML('');
$attribute = $document->documentElement->getAttributeNode('attribute');
echo "-- Attribute tests --\n";
var_dump($document->saveHTML());
var_dump($attribute->textContent);
$attribute->textContent = 'new value';
var_dump($attribute->textContent);
var_dump($document->saveHTML());
$attribute->textContent = 'hello & world';
var_dump($attribute->textContent);
var_dump($document->saveHTML());
$attribute->textContent = 'hi';
var_dump($attribute->textContent);
var_dump($document->saveHTML());
$attribute->textContent = 'quote "test"';
var_dump($attribute->textContent);
var_dump($document->saveHTML());
$attribute->textContent = "quote 'test'";
var_dump($attribute->textContent);
var_dump($document->saveHTML());
$attribute->textContent = "quote '\"test\"'";
var_dump($attribute->textContent);
var_dump($document->saveHTML());
echo "-- Document element tests --\n";
$document->documentElement->textContent = 'hello & world';
var_dump($document->documentElement->textContent);
var_dump($document->saveHTML());
$document->documentElement->textContent = 'hi';
var_dump($document->documentElement->textContent);
var_dump($document->saveHTML());
$document->documentElement->textContent = 'quote "test"';
var_dump($document->documentElement->textContent);
var_dump($document->saveHTML());
$document->documentElement->textContent = "quote 'test'";
var_dump($document->documentElement->textContent);
var_dump($document->saveHTML());
?>
--EXPECT--
-- Attribute tests --
string(38) "
"
string(5) "value"
string(9) "new value"
string(42) "
"
string(13) "hello & world"
string(50) "
"
string(9) "hi"
string(54) "
"
string(12) "quote "test""
string(45) "
"
string(12) "quote 'test'"
string(45) "
"
string(14) "quote '"test"'"
string(57) "
"
-- Document element tests --
string(13) "hello & world"
string(74) "hello & world
"
string(9) "hi"
string(78) "<b>hi</b>
"
string(12) "quote "test""
string(69) "quote "test"
"
string(12) "quote 'test'"
string(69) "quote 'test'
"