Skip to content

Commit

Permalink
Merge pull request #64 from veewee/revert-2.11.1
Browse files Browse the repository at this point in the history
Revert "More stable node loading"
  • Loading branch information
veewee authored Nov 12, 2023
2 parents 2331ce1 + 7146722 commit e84f554
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
5 changes: 2 additions & 3 deletions src/Xml/Dom/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use function Psl\Vec\map;
use function VeeWee\Xml\Dom\Configurator\loader;
use function VeeWee\Xml\Dom\Loader\xml_file_loader;
use function VeeWee\Xml\Dom\Loader\xml_node_loader;
use function VeeWee\Xml\Dom\Loader\xml_string_loader;
use function VeeWee\Xml\Dom\Locator\document_element;
use function VeeWee\Xml\Dom\Mapper\xml_string;
Expand Down Expand Up @@ -79,9 +80,7 @@ public static function fromXmlString(string $xml, callable ...$configurators): s
public static function fromXmlNode(DOMNode $node, callable ...$configurators): self
{
return self::configure(
loader(xml_string_loader(
xml_string()($node)
)),
loader(xml_node_loader($node)),
...$configurators
);
}
Expand Down
19 changes: 0 additions & 19 deletions tests/Xml/Dom/DocumentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
use VeeWee\Xml\Dom\Document;
use VeeWee\Xml\Dom\Traverser\Action;
use VeeWee\Xml\Dom\Traverser\Visitor\AbstractVisitor;
use VeeWee\Xml\Dom\Traverser\Visitor\RemoveNamespaces;
use function Psl\Fun\identity;
use function VeeWee\Xml\Dom\Configurator\traverse;
use function VeeWee\Xml\Dom\Configurator\trim_spaces;
use function VeeWee\Xml\Dom\Configurator\utf8;
use function VeeWee\Xml\Dom\Locator\document_element;
Expand Down Expand Up @@ -80,23 +78,6 @@ public function test_it_can_create_a_document_from_xml_node(): void
static::assertXmlStringEqualsXmlString($xml, $doc->toXmlString());
}

/**
* @see https://github.com/php/php-src/issues/12616
*/
public function test_it_can_create_a_document_from_xml_node_with_removed_namespaces(): void
{
$source = Document::fromXmlString(
'<hello xmlns="https://hello" />',
traverse(RemoveNamespaces::all())
);

$doc = Document::fromXmlNode(
$source->map(document_element()),
identity()
);

static::assertXmlStringEqualsXmlString('<hello />', $doc->toXmlString());
}

public function test_it_can_create_a_document_from_xml_file(): void
{
Expand Down

0 comments on commit e84f554

Please sign in to comment.