Permalink
Browse files

Allow warnings for Xml entities.

For some installations libxml_use_internal_errors() does not work,
a warning is another way to measure the entities not being loaded.
  • Loading branch information...
1 parent 418672f commit e218738a49b9b1b6c38e386a94b80b3eed209a6b @markstory markstory committed Jul 14, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/Cake/Test/Case/Utility/XmlTest.php
@@ -1049,8 +1049,12 @@ public function testNoEntityLoading() {
<xxe>&payload;</xxe>
</request>
XML;
- $result = Xml::build($xml);
- $this->assertEquals('', (string)$result->xxe);
+ try {
+ $result = Xml::build($xml);
+ $this->assertEquals('', (string)$result->xxe);
+ } catch (Exception $e) {
+ $this->assertTrue(true, 'A warning was raised meaning external entities were not loaded');
+ }
}
}

0 comments on commit e218738

Please sign in to comment.