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 a7c79e5 commit 22d4cb3794e78381556636f90849608d4f1864e9 @markstory markstory committed Jul 14, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/Cake/Test/Case/Utility/XmlTest.php
@@ -1053,8 +1053,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 (PHPUnit_Framework_Error_Warning $e) {
+ $this->assertTrue(true, 'A warning was raised meaning external entities were not loaded');
+ }
}
}

0 comments on commit 22d4cb3

Please sign in to comment.